Sub Command Permissions | Slash Commands
Currently, required permissions for a slash command can only be set for the top level command. This is fine until you want to mix in sub commands where some require permissions and some do not.
For example, I want my bot to have a /emoji command with multiple sub commands that do not require permissions such as /emoji list and /emoji expand. But I also want to have /emoji upload and /emoji delete as commands to upload and delete emojis respectively. These commands should of course require MANAGE_EMOJIS permissions but as it currently stands I have to either restrict all of the emoji commands to MANAGE_EMOJIS, allow anyone in the server to upload emojis, or somehow separate them into different top level commands such as /emojiupload and /emojidelete which is less than ideal as it means no longer having logical sub command separation, it eats into the 100 command limit, and looks ugly and less user friendly to have no spaces like this.
I propose that the default_member_permissions field should be added to options, where it is only allowed when an option is of type SUB_COMMAND or SUB_COMMAND_GROUP. The behaviour should then be that Command permissions take precedent over SUB_COMMAND_GROUP permissions, which take precedent over SUB_COMMAND permissions.
You could then, for example, have a top level command which requires MANAGE_CHANNELS, and then a sub command under it which requires MANAGE_MESSAGES. This would mean the the sub command requires both MANAGE_CHANNELS and MANAGE_MESSAGES but the top level command and any other sub command (group)s require only MANAGE_CHANNELS.
-
Why does this not have a million upvotes and a billion comments? Not having subcommand permissions is really bothersome for the longevity of larger bots.
Take the most common bot feature, tickets.
I want everyone to be able to do /ticket create, but only admins should be able to do /ticket delete
1
Iniciar sesión para dejar un comentario.
Comentarios
1 comentario