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 Expressions | Upload, edit and delete custom emoji, stickers and Soundboard sounds |
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 |
1 << 15 | 32768 | Connect | Join voice channels |
1 << 16 | 65536 | Speak | Talk in voice channels. Bots need it to join voice at all (Voice for bots) |
1 << 17 | 131072 | Video | Turn on a camera or share a screen in voice channels |
1 << 18 | 262144 | Baffle Upload | Put a Baffles price on attached files (baffles when sending). Official baff.gg servers only |
1 << 19 | 524288 | Baffle Withdraw | Move a channel's earned Baffles to your account (people only; bots can't hold Baffles) |
1 << 20 | 1048576 | Manage Baffles | Set a channel's price to open it. Official baff.gg servers only |
1 << 21 | 2097152 | Moderate Members | Time out people below your highest role (Timeouts) |
1 << 22 | 4194304 | View Audit Log | Read the server's audit log (Manage Server can too) |
1 << 23 | 8388608 | Use Soundboard | Play Soundboard sounds in voice channels (together with Speak). On for @everyone by default |
1 << 24 | 16777216 | Manage Threads | Rename, hide, lock and delete threads and forum posts, change any post's tags, and reply in locked ones |
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, and forum posts their forum's.
- A member who is timed out keeps only View Channel until it ends (owners and Administrators can't be timed out).
A channel your bot can't View looks like it doesn't exist: it's left out of lists and its URLs answer 404.
Baffles only work in official baff.gg servers. Baffles are baff.gg's own currency. Everywhere else, Baffle Upload and Manage Baffles do nothing: they never show up in the permissions you get back for a channel, even for owners and Administrators, and anything priced is refused with 403 baffles_official_only. Baffle Withdraw still works, only to empty Baffles a channel earned before.
Paid channels. In an official server, a channel can cost Baffles to open; it carries accessPrice. People who haven't paid get 403 channel_locked from its routes and no events from it. Bots in the server are never charged and read it like any channel.
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.