Remora/Remora.Discord

Ability to opt out of text commands

Octol1ttle opened this issue · 1 comments

Description

ServiceCollectionExtensions#AddDiscordCommands can add two types of commands: text commands (default prefix is !) and slash commands (enabled using an argument). While the argument can be used to opt out of slash commands, there's no easy way to opt out of text commands. Furthermore, the documentation for Remora.Discord.Commands doesn't explicitly mention text commands or the way they can be called, which can cause some users (like me) to think that they are not enabled.

I propose to add a second argument to AddDiscordCommands to allow disabling text commands while keeping slash. Other possible implementations I could think of (but probably aren't good in practice 😄) are: splitting the method into two or more (AddDiscordTextCommands, AddDiscordSlashCommands) or using an approach similar to adding command groups (WithDiscordCommandTypes().AddText(), WithDiscordCommandTypes().AddSlash())

Why This is Needed

Some users may not want to use text commands, as they lack some features of slash commands, like client-side input validation.

Alternatives Considered

A solution that would allow users to fine tune which commands are text, slash or both would be to add two new attributes: [SlashOnly] and [TextOnly].

Additional Details

No response

Nihlus commented

I took a quick dive into the available options, and you can pass useDefaultCommandResponder as false to elide addition of the default text handler. Closing.