serenity-rs / poise

Discord bot command framework for serenity, with advanced features like edit tracking and flexible argument parsing
MIT License
624 stars 111 forks source link

Add serenity's `CommandId` to slash commands created with poise. To reference it in the help menu #235

Open asibahi opened 8 months ago

asibahi commented 8 months ago

Discord allows everyone to type command snowflakes, as shown here. Serenity's CommandId type is the COMMAND_ID being used here, as far as I can tell.

Currently in poise when registering commands this info is discarded and not stored in the Framework. So poise's Command objects lacks this info, so I cannot have my commands linked from the help menu.

tl;dr : this would be nice if I could do it automatically from the help menu. Even if just as a cmd.format_for_discord() method on poise::Command.

image
jamesbt365 commented 3 months ago

The framework is immutable after its setup and the framework setup function doesn't exist on the serenity-next branch anymore as we migrate. Even still, I'm not sure how much can be mutated there, if at all.

Registers on startup are optional, handled by the user, storing the result in the framework may be challenging, but I'm not sure if this is entirely out of scope.