Closed 0xlosh closed 2 months ago
nvm literally just found it 5 seconds later, its ctx.serenity_context()
Use poise's data. Check out the examples.
Use poise's data. Check out the examples.
yes i could, but then i have to add it to both data fields (serenity context and pose::command context)
No you wouldnt, see the poise event handler example.
No you wouldnt, see the poise event handler example.
you are right, true. is there any disadvantage in using ctx.serenity_context()
in the slash commands?
Yes, its fine, but you should do your command responses through poise's Context
, feel free to use serenity's context to do other stuff as you please.
Just to let you know we have a discord server which you could use to ask questions instead of opening github issues. (https://discord.gg/serenity-rs)
slash command example:
error:
attempted to take value of method data on type poise::Context<'_, (), ErrReport> method, not a field
im aware those are two differentContext
types, one isserenity::client::context
, the other ispoise::Context
for example in the Handler trait i have a different
Context
type, which can access data, how can i access that in my slash commands? i would like to shareRedisPool
in slash commands and in the Handler struct.