requiredPermissions, check them with can(), and read them from a PermissionSet. The names below are the exact strings to use.
There are 31 permissions, codes 0 through 30. Names are what you write; the integer codes are the wire contract, and they matter only if you decode a raw grant yourself.
For how declaring and granting work together, see the Permissions concept.
Administrator
If your bot holds
administrator in a server, can() returns true for every other permission there. Ask for it only when your bot genuinely needs full control.
The expansion happens in
can() only. administrator stays a distinct bit in a decoded PermissionSet, so a set where only administrator is true still has every other boolean false. Read it through can(), not by inspecting the booleans directly.Server management
Viewing
view_text is what puts a text channel on your bot’s firehose. Without it in a given channel, your bot does not receive that channel’s messages at all.Messaging
Members
Voice
A bot holding
voice_video still cannot publish camera or screenshare. A bot session’s media credential is minted microphone-only, so video is denied at the credential rather than by the SDK, and peer-to-peer video is deleted from the platform. There is no video path to enable.Using names in code
Every name above is a value of thePermissionName type.
PermissionName
PERMISSION_CODES
0 through 30.
PERMISSION_NAMES
PERMISSION_NAMES[14] is 'message_send'. That holds because the code map is dense with no gaps.
PermissionSet
permissions(serverId), and the same shape is spread into the permissionsUpdate payload.
number
The bot’s effective rank in the server. Moderation actions compare ranks: your bot cannot kick, ban, or time out a member whose rank is not below its own.
boolean
One boolean per permission name.
true means the bot holds it in this server.decodePermArray
PermissionSet. Missing or falsy entries decode to false. You need this only when reading a grant off a raw frame; the SDK already decodes the ones it delivers.
Next
Permissions concept
How declaring and granting fit together.
Errors
Reading the permission a denial names.
Client
can(), permissions(), and visibleChannelIds().
Voice keys
Why voice_listen decides what a bot hears.