You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we can only use serenity::Context in ArgumentConvert, PopArgument and SlashArgument, because all these traits are imported from serenity.
But what if we want to make a string-to-command converter? We are unable to use the ctx.framework() method in any way to get the command. The only solution would be to export the commands variable from other file, which is not a good solution.
Now the trait looks like this:
#[async_trait]pubtraitArgumentConvert:Sized{typeErr;asyncfnconvert(ctx:&Context/* <- serenity::client::context::Context, NOT poise::Context<'_, Data, Error> */,guild_id:Option<GuildId>,channel_id:Option<ChannelId>,s:&str,) -> Result<Self,Self::Err>;}
How about creating a custom implementation, with Poise context support? It would be very helpful.
The text was updated successfully, but these errors were encountered:
I attempted something similar before, I think it could be made to work.
For motivation purposes and curiosity - what would you need a string-to-command converter for?
for e.g. custom help command, you can simply pass Command as a parameter. I know you can pass String and then get command by its name/aliases/etc. but this would be simpler.
Currently, we can only use serenity::Context in ArgumentConvert, PopArgument and SlashArgument, because all these traits are imported from serenity.
But what if we want to make a string-to-command converter? We are unable to use the ctx.framework() method in any way to get the command. The only solution would be to export the commands variable from other file, which is not a good solution.
Now the trait looks like this:
How about creating a custom implementation, with Poise context support? It would be very helpful.
The text was updated successfully, but these errors were encountered: