Closed maxwai closed 1 year ago
Poise Context is a wrapper around serenity Context (and a few other fields). You can access the inner context with .serenity_context()
. For example: ctx.serenity_context().quit()
Yes I know about the .serenity_context()
method. But if I try this I get following error:
error[E0599]: no method named `quit` found for reference `&poise::serenity_prelude::Context` in the current scope
--> src/bot/commands.rs:64:28
|
64 | ctx.serenity_context().quit();
| ^^^^ method not found in `&Context`
Do I maybe need to add a special serenity dependency in my Cargo.toml? Currently it looks like this:
[dependencies]
tokio = { version = "1.25.1", features = ["macros", "rt-multi-thread"] }
poise = "0.5.5"
...
I tried adding serenity = "0.11.6"
but this doesn't help
I found the problem. The quit
Method was removed from Context
and added as shutdown
in the ShardManager
so now I just need a way to access the ShardManager
You can do that with .framework().shard_manager
thx for the help
There doesn't seem to be a quit/stop command available in the ctx object to be able to do a stop command to stop the bot from discord directly.
In serenity this was added for this issue https://github.com/serenity-rs/serenity/issues/70 with this commit: https://github.com/serenity-rs/serenity/commit/561b0e38b4cda6661425f76c8d707d58d0f12d09