Bafflux 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 EmojiUpload, rename and delete custom emoji
1 << 124096Mention EveryonePing @everyone and @here
1 << 138192View ChannelSee channels and read their messages
1 << 1416384Manage WebhooksCreate and delete webhooks

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.

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.