When talking about permissions there are three groups of permissions that may be talked about, user bot permissions, user discord permissions and bot discord permissions.
These are permissions granted to users (or to users via roles) by server managers.
These permissions grant access to bot actions, such as sending messages, editing messages, etc.
These permissions can be set at a global level, or a per channel level.
Some permissions are limited to only guild level permissions, such as the management permisisons.
Permissions work off a bitfield type model, with roles being able to be assigned permissions that they have. The base level is roles, and permission overrides can be assigned to users, roles (on channels) and users (on channels).
Here is a table for each permission, its bitfield value and the description
Permission | Bitfield Value | Description |
---|---|---|
VIEW_MESSAGES | 0x00000001 (1 << 0) | Grants access to viewing messages, currently has no effect |
EDIT_MESSAGES | 0x00000002 (1 << 1) | Grants access to editing messages previously sent via the bot account |
SEND_MESSAGES | 0x00000004 (1 << 2) | Grants access to sending messages via the bot account |
DELETE_MESSAGES | 0x00000008 (1 << 3) | Grants access to deleting messages previously sent via the bot account |
MANAGE_PERMISSIONS | 0x00000010 (1 << 4) | Grants access to managing bot permissions for users and roles. Doesn't effect discord permissions |
MANAGE_CONFIG | 0x00000020 (1 << 5) | Grants access to managing the bot's configuration |
The hierarchy of permissions is simaler to how discord's permissions work.
Permissions are first calculated for the first level, then applied moving down the levels.
For roles (at both levels) the user's permissions is the sum of all roles the user has.
At the top level (roles at the guild level) each permission only has a toggle for allowed. This means that if a permission is not toggled on for any of the user's roles they will not have that permission at this level.
For all other levels each permission can be set to either allowed or denied, with an inbetween state of "inhert" or "reset". The inherit state means that the permission is inherited from the previous level(s). Otherwise an allow or deny state overrides all other levels above.
Deny overrides are applied first, and then allow overrides, meaning a permission that is both denied and allowed at one of the levels will be allowed for that level.
Command: /config permissions manage
Will return a select menu that can be used to change permissions.
Command: /config permissions list
Will only return a list of roles / users that have permissions set. To view what permission each entity has use the manage command.
Command: /config permissions quickstart
Will allow permissions for permissions in set presets. It's useful to get started quickly.
These are discord permissions a user must have, to be able to use a command. Currently the only restriction is on the VIEW_CHANNELS
discord permission.
That permission is required for making message management actions, in the channel the message is / will be in.
These are discord permissions the bot requires to function.
To carry out message actions:
VIEW_CHANNELS
/ READ_MESSAGES
(it might be either of these names)SEND_MESSAGES
EMBED_LINKS
ATTACH_FILES
SEND_MESSAGES_IN_THREADS
(only for threads)USE_EXTERNAL_EMOJIS
(only if required in the message)To enable logging:
MANAGE_WEBHOOKS
(on the logging channel)