baff.gg Docs Developer Portal

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.

BitValueNameAllows
1 << 01AdministratorEverything, everywhere in the server
1 << 12Manage ServerRename the server and change its icon; add bots
1 << 24Manage RolesCreate, edit and give roles below your highest one; change channel permissions
1 << 38Manage ChannelsCreate, edit, move and delete channels
1 << 416Kick MembersRemove people below your highest role
1 << 532Ban MembersBan and unban people below your highest role
1 << 664Create InviteMake invite links
1 << 7128Send MessagesPost messages and use commands
1 << 8256Manage MessagesDelete others' messages, pin, publish anyone's announcements
1 << 9512Attach FilesUpload files
1 << 101024Add ReactionsAdd new reactions
1 << 112048Manage ExpressionsUpload, edit and delete custom emoji, stickers and Soundboard sounds
1 << 124096Mention EveryonePing @everyone and @here
1 << 138192View ChannelSee channels and read their messages
1 << 1416384Manage WebhooksCreate and delete webhooks
1 << 1532768ConnectJoin voice channels
1 << 1665536SpeakTalk in voice channels. Bots need it to join voice at all (Voice for bots)
1 << 17131072VideoTurn on a camera or share a screen in voice channels
1 << 18262144Baffle UploadPut a Baffles price on attached files (baffles when sending). Official baff.gg servers only
1 << 19524288Baffle WithdrawMove a channel's earned Baffles to your account (people only; bots can't hold Baffles)
1 << 201048576Manage BafflesSet a channel's price to open it. Official baff.gg servers only
1 << 212097152Moderate MembersTime out people below your highest role (Timeouts)
1 << 224194304View Audit LogRead the server's audit log (Manage Server can too)
1 << 238388608Use SoundboardPlay Soundboard sounds in voice channels (together with Speak). On for @everyone by default
1 << 2416777216Manage ThreadsRename, 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

  1. Start with the @everyone role's permissions, then add every role the member has.
  2. Owners and Administrators have every permission, everywhere.
  3. In a channel, its overrides apply on top: first the @everyone override, then all the member's roles together, then the member's own. Each override takes some bits away (deny) and adds some (allow).
  4. Threads use their channel's permissions, and forum posts their forum's.
  5. 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.