Skip to content

Commit

Permalink
docs(PermissionFlagsBits): add descriptions (#757)
Browse files Browse the repository at this point in the history
  • Loading branch information
almeidx authored Apr 24, 2023
1 parent 3dac5b9 commit 7c69137
Show file tree
Hide file tree
Showing 2 changed files with 406 additions and 0 deletions.
203 changes: 203 additions & 0 deletions deno/payloads/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,57 +8,260 @@ import type { LocaleString } from '../rest/common.ts';
* replicate them in some way
*/
export const PermissionFlagsBits = {
/**
* Allows creation of instant invites
*
* Applies to channel types: Text, Voice, Stage
*/
CreateInstantInvite: 1n << 0n,
/**
* Allows kicking members
*/
KickMembers: 1n << 1n,
/**
* Allows banning members
*/
BanMembers: 1n << 2n,
/**
* Allows all permissions and bypasses channel permission overwrites
*/
Administrator: 1n << 3n,
/**
* Allows management and editing of channels
*
* Applies to channel types: Text, Voice, Stage
*/
ManageChannels: 1n << 4n,
/**
* Allows management and editing of the guild
*/
ManageGuild: 1n << 5n,
/**
* Allows for the addition of reactions to messages
*
* Applies to channel types: Text, Voice, Stage
*/
AddReactions: 1n << 6n,
/**
* Allows for viewing of audit logs
*/
ViewAuditLog: 1n << 7n,
/**
* Allows for using priority speaker in a voice channel
*
* Applies to channel types: Voice
*/
PrioritySpeaker: 1n << 8n,
/**
* Allows the user to go live
*
* Applies to channel types: Voice, Stage
*/
Stream: 1n << 9n,
/**
* Allows guild members to view a channel, which includes reading messages in text channels and joining voice channels
*
* Applies to channel types: Text, Voice, Stage
*/
ViewChannel: 1n << 10n,
/**
* Allows for sending messages in a channel and creating threads in a forum
* (does not allow sending messages in threads)
*
* Applies to channel types: Text, Voice, Stage
*/
SendMessages: 1n << 11n,
/**
* Allows for sending of `/tts` messages
*
* Applies to channel types: Text, Voice, Stage
*/
SendTTSMessages: 1n << 12n,
/**
* Allows for deletion of other users messages
*
* Applies to channel types: Text, Voice, Stage
*/
ManageMessages: 1n << 13n,
/**
* Links sent by users with this permission will be auto-embedded
*
* Applies to channel types: Text, Voice, Stage
*/
EmbedLinks: 1n << 14n,
/**
* Allows for uploading images and files
*
* Applies to channel types: Text, Voice, Stage
*/
AttachFiles: 1n << 15n,
/**
* Allows for reading of message history
*
* Applies to channel types: Text, Voice, Stage
*/
ReadMessageHistory: 1n << 16n,
/**
* Allows for using the `@everyone` tag to notify all users in a channel,
* and the `@here` tag to notify all online users in a channel
*
* Applies to channel types: Text, Voice, Stage
*/
MentionEveryone: 1n << 17n,
/**
* Allows the usage of custom emojis from other servers
*
* Applies to channel types: Text, Voice, Stage
*/
UseExternalEmojis: 1n << 18n,
/**
* Allows for viewing guild insights
*/
ViewGuildInsights: 1n << 19n,
/**
* Allows for joining of a voice channel
*
* Applies to channel types: Voice, Stage
*/
Connect: 1n << 20n,
/**
* Allows for speaking in a voice channel
*
* Applies to channel types: Voice
*/
Speak: 1n << 21n,
/**
* Allows for muting members in a voice channel
*
* Applies to channel types: Voice, Stage
*/
MuteMembers: 1n << 22n,
/**
* Allows for deafening of members in a voice channel
*
* Applies to channel types: Voice
*/
DeafenMembers: 1n << 23n,
/**
* Allows for moving of members between voice channels
*
* Applies to channel types: Voice, Stage
*/
MoveMembers: 1n << 24n,
/**
* Allows for using voice-activity-detection in a voice channel
*
* Applies to channel types: Voice
*/
UseVAD: 1n << 25n,
/**
* Allows for modification of own nickname
*/
ChangeNickname: 1n << 26n,
/**
* Allows for modification of other users nicknames
*/
ManageNicknames: 1n << 27n,
/**
* Allows management and editing of roles
*
* Applies to channel types: Text, Voice, Stage
*/
ManageRoles: 1n << 28n,
/**
* Allows management and editing of webhooks
*
* Applies to channel types: Text, Voice, Stage
*/
ManageWebhooks: 1n << 29n,
/**
* Allows management and editing of emojis, stickers, and soundboard sounds
*
* @deprecated This is the old name for {@apilink PermissionFlagsBits#ManageGuildExpressions}
*/
ManageEmojisAndStickers: 1n << 30n,
/**
* Allows management and editing of emojis, stickers, and soundboard sounds
*/
ManageGuildExpressions: 1n << 30n,
/**
* Allows members to use application commands, including slash commands and context menu commands
*
* Applies to channel types: Text, Voice, Stage
*/
UseApplicationCommands: 1n << 31n,
/**
* Allows for requesting to speak in stage channels
*
* Applies to channel types: Stage
*/
RequestToSpeak: 1n << 32n,
/**
* Allows for creating, editing, and deleting scheduled events
*
* Applies to channel types: Voice, Stage
*/
ManageEvents: 1n << 33n,
/**
* Allows for deleting and archiving threads, and viewing all private threads
*
* Applies to channel types: Text
*/
ManageThreads: 1n << 34n,
/**
* Allows for creating public and announcement threads
*
* Applies to channel types: Text
*/
CreatePublicThreads: 1n << 35n,
/**
* Allows for creating private threads
*
* Applies to channel types: Text
*/
CreatePrivateThreads: 1n << 36n,
/**
* Allows the usage of custom stickers from other servers
*
* Applies to channel types: Text, Voice, Stage
*/
UseExternalStickers: 1n << 37n,
/**
* Allows for sending messages in threads
*
* Applies to channel types: Text
*/
SendMessagesInThreads: 1n << 38n,
/**
* Allows for using Activities (applications with the {@apilink ApplicationFlags.Embedded} flag) in a voice channel
*
* Applies to channel types: Voice
*/
UseEmbeddedActivities: 1n << 39n,
/**
* Allows for timing out users to prevent them from sending or reacting to messages in chat and threads,
* and from speaking in voice and stage channels
*/
ModerateMembers: 1n << 40n,
/**
* Allows for viewing role subscription insights
*/
ViewCreatorMonetizationAnalytics: 1n << 41n,
/**
* Allows for using soundboard in a voice channel
*
* Applies to channel types: Voice
*/
UseSoundboard: 1n << 42n,
/**
* @unstable This permission flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
UseExternalSounds: 1n << 45n,
/**
* Allows sending voice messages
*
* Applies to channel types: Text, Voice, Stage
*/
SendVoiceMessages: 1n << 46n,
} as const;

Expand Down
Loading

1 comment on commit 7c69137

@vercel
Copy link

@vercel vercel bot commented on 7c69137 Apr 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.