This reworks how the permissions for admin commands are handled.
Before, the permissions would be checked on command execution. When the user didn't have a specified role, the command would return an error message and log the incident.
Now, we are using the built-in permission system of slash commands. When a user doesn't have the required role in the guild, the admin commands will be grayed out and the user won't be able to execute them.
The implementation is a bit hacky, because the permissions are defined in annotations and we can't directly access the config from there. So now we define a global variable in a cog that we load first and then use that to generate the permissions.
This allows us to define the permissions in the config without hard-coding them in the annotation.
⚠️ This requires changing the config of the bot! ⚠️
Relevant issue: Closes #133
Description:
This reworks how the permissions for admin commands are handled.
Before, the permissions would be checked on command execution. When the user didn't have a specified role, the command would return an error message and log the incident.
Now, we are using the built-in permission system of slash commands. When a user doesn't have the required role in the guild, the admin commands will be grayed out and the user won't be able to execute them.
The implementation is a bit hacky, because the permissions are defined in annotations and we can't directly access the config from there. So now we define a global variable in a cog that we load first and then use that to generate the permissions. This allows us to define the permissions in the config without hard-coding them in the annotation.
⚠️ This requires changing the config of the bot! ⚠️
Checklist: