API reference
Permissions
The permission bits, how they combine, and how channels change them.
Permissions are one number where each bit allows something. Add bits together (or | them) to combine them. The install link's permissions= value is this number, and so is every role's permissions.
| Bit | Value | Name | Allows |
|---|---|---|---|
1 << 0 | 1 | Administrator | Everything, everywhere in the server |
1 << 1 | 2 | Manage Server | Rename the server and change its icon; add bots |
1 << 2 | 4 | Manage Roles | Create, edit and give roles below your highest one; change channel permissions |
1 << 3 | 8 | Manage Channels | Create, edit, move and delete channels |
1 << 4 | 16 | Kick Members | Remove people below your highest role |
1 << 5 | 32 | Ban Members | Ban and unban people below your highest role |
1 << 6 | 64 | Create Invite | Make invite links |
1 << 7 | 128 | Send Messages | Post messages and use commands |
1 << 8 | 256 | Manage Messages | Delete others' messages, pin, publish anyone's announcements |
1 << 9 | 512 | Attach Files | Upload files |
1 << 10 | 1024 | Add Reactions | Add new reactions |
1 << 11 | 2048 | Manage Emoji | Upload, rename and delete custom emoji |
1 << 12 | 4096 | Mention Everyone | Ping @everyone and @here |
1 << 13 | 8192 | View Channel | See channels and read their messages |
1 << 14 | 16384 | Manage Webhooks | Create and delete webhooks |
For example, View Channel + Send Messages + Add Reactions is 8192 + 128 + 1024 = 9344.
How they add up
- Start with the
@everyonerole's permissions, then add every role the member has. - Owners and Administrators have every permission, everywhere.
- In a channel, its overrides apply on top: first the
@everyoneoverride, then all the member's roles together, then the member's own. Each override takes some bits away (deny) and adds some (allow). - Threads use their channel's permissions.
A channel your bot can't View looks like it doesn't exist: it's left out of lists and its URLs answer 404.
Hierarchy
Roles are ordered. Your bot can only manage roles below its own highest role, can't hand out permissions it doesn't have, and can only kick or ban people whose highest role is below its. Server owners can move your bot's role higher if it needs to manage more.