Use PermissionsBitField
Flags live under PermissionsBitField.Flags. Mix strings, arrays, or raw
bigint values when building instances.
Updated notes for the BigInt-based PermissionsBitField, common Discord flags, and practical
checks so you can release slash commands without guesswork.
npm install discord.js@latest
Official permissions docs ->
Use the helpers discord.js exposes instead of juggling raw numbers. Everything below sticks
to bigint so you avoid precision issues.
Flags live under PermissionsBitField.Flags. Mix strings, arrays, or raw
bigint values when building instances.
Permission numbers exceed the 53-bit safe integer limit. Persist them as strings if you need to
store them, and cast back with BigInt().
Set defaultMemberPermissions during command registration, then confirm the invoking
member via interaction.memberPermissions?.has().
import { Client, GatewayIntentBits, PermissionsBitField } from 'discord.js';
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
const required = new PermissionsBitField([
PermissionsBitField.Flags.ManageGuild,
PermissionsBitField.Flags.ManageRoles,
]);
client.on('interactionCreate', async (interaction) => {
if (!interaction.isChatInputCommand()) return;
if (!interaction.memberPermissions?.has(required)) {
return interaction.reply({
content: 'You need Manage Guild + Manage Roles for this command.',
ephemeral: true,
});
}
// command logic...
});
await client.login(process.env.BOT_TOKEN);
Grouped selection of the flags bots request most often. Combine them with role and channel overwrites, and reference the developer docs for the exhaustive matrix.
| Flag | Description | Scope |
|---|---|---|
| Guild administration | ||
Administrator |
Bypasses all channel overwrites. Reserve for internal or extremely trusted integrations. | Guild-wide |
ManageGuild |
Edit server configuration, community settings, and AutoMod rules. | Guild |
ManageRoles |
Create, reorder, and edit roles along with their permissions. | Guild |
ManageChannels |
Create/delete channels and update channel-specific overrides. | Text / Voice / Stage |
ManageGuildExpressions |
Manage emoji, stickers, and soundboard audio. Replaces the legacy emoji/sticker flag. | Guild |
ManageEvents |
Create, edit, and cancel scheduled events including Stage sessions. | Guild / Stage |
ManageWebhooks |
Create, edit, and remove webhooks across channels. | Text / Voice / Stage |
ViewAuditLog |
Read the server audit log for compliance tooling and debugging what changed. | Guild |
ViewGuildInsights |
Access community insight dashboards for growth analytics. | Guild |
ViewCreatorMonetizationAnalytics |
See revenue analytics for monetized communities. | Guild |
| Moderation & safety | ||
KickMembers |
Remove members from the guild without banning. | Guild |
BanMembers |
Ban and unban members, optionally pruning recent messages. | Guild |
ModerateMembers |
Timeout members for up to 28 days. | Guild |
ManageNicknames |
Change other members' nicknames. | Guild |
ChangeNickname |
Allow members (or your bot) to alter their own nickname. | Guild |
ManageThreads |
Archive, unarchive, delete, and edit all threads in a channel. | Text |
| Messaging & threads | ||
ViewChannel |
Read text channels, browse forums, and join voice channels. | Text / Voice / Stage |
SendMessages |
Post in channels and create forum posts. | Text / Stage |
SendMessagesInThreads |
Reply within existing public or private threads. | Text |
ManageMessages |
Delete messages from others and pin/unpin messages. | Text / Stage |
MentionEveryone |
Use @everyone, @here, and role
mentions. |
Text / Stage |
ReadMessageHistory |
Access messages sent before the member joined the channel. | Text / Stage |
AddReactions |
React to messages and participate in emoji-based workflows. | Text / Voice / Stage |
EmbedLinks |
Send rich embeds (Discord will expand supported URLs). | Text / Stage |
AttachFiles |
Upload files and images. | Text / Stage |
CreatePublicThreads |
Spin up public threads inside existing channels. | Text |
CreatePrivateThreads |
Open invite-only threads for focused collaboration. | Text |
UseExternalEmojis |
React or send emoji from other servers the member can see. | Text / Voice / Stage |
UseExternalStickers |
Send stickers from external communities. | Text |
UseApplicationCommands |
Run slash commands, context menus, and other application commands. | Text / Stage |
| Voice, stage, & activities | ||
Connect |
Join voice or stage channels. | Voice / Stage |
Speak |
Transmit audio in voice channels. | Voice |
Stream |
Go live or share screen inside voice channels. | Voice |
PrioritySpeaker |
Gain priority speaker status in voice channels. | Voice |
UseVAD |
Use voice activity detection instead of push-to-talk. | Voice |
MuteMembers |
Server mute other users. | Voice / Stage |
DeafenMembers |
Server deafen users (stop incoming audio). | Voice |
MoveMembers |
Move members between voice or stage channels. | Voice / Stage |
RequestToSpeak |
Request the stage moderator to allow speaking. | Stage |
UseEmbeddedActivities |
Start voice activities (YouTube, games, whiteboards) in a channel. | Voice |
UseSoundboard |
Play soundboard clips, including community-created ones. | Voice |
UseExternalSounds |
Use soundboard clips uploaded to other guilds. | Voice |
SendVoiceMessages |
Send voice messages in text channels. | Text |