Permissions Reference
NexusGuild uses Discord-compatible bitwise permission flags. Every role stores a
BIGINT bitmask. A user's effective permissions are the bitwise OR of all
their role bitmasks, with channel-level overrides applied on top.
Overview
Permissions are 64-bit integers (BigInt in JavaScript). Each permission is a single bit:
const canSendAndRead = SEND_MESSAGES | READ_MESSAGE_HISTORY;
function hasPermission(userPerms, flag) {
if (userPerms & BigInt(8)) return true;
return (userPerms & flag) === flag;
}
How It Works
- Each server has an @everyone role that applies to all members.
- Additional roles can grant extra permissions on top.
- A member's effective permissions = bitwise OR of all their role permissions.
- Channel-level permission overrides can grant or deny specific flags per role for that channel only.
- Server owners bypass all permission checks — they always have full access.
- The ADMINISTRATOR flag grants all permissions, bypassing channel overrides too.
Default @everyone Permissions
New servers give @everyone this bitmask: 103926848
| Permission | Value |
| VIEW_CHANNEL | 1024 |
| SEND_MESSAGES | 2048 |
| EMBED_LINKS | 16384 |
| ATTACH_FILES | 32768 |
| READ_MESSAGE_HISTORY | 65536 |
| ADD_REACTIONS | 64 |
| CONNECT | 1048576 |
| SPEAK | 2097152 |
| USE_VAD | 33554432 |
| CHANGE_NICKNAME | 67108864 |
Checking Permissions in Code
Server-side (Node.js)
import { PERMISSIONS, PermissionHandler } from './config/permissions.js';
const canSend = PermissionHandler.hasPermission(userPerms, PERMISSIONS.SEND_MESSAGES);
Client-side (via API)
const { myPermissions } = await fetch(`/api/servers/${serverId}/members`)
.then(r => r.json());
const perms = BigInt(myPermissions);
function hasPermission(flag) {
if (perms & 8n) return true;
return (perms & flag) === flag;
}
if (hasPermission(16n)) {
showCreateChannelButton();
}
Bot-side (via REST API)
const roles = await fetch(`/api/v1/guilds/${guildId}/roles`, {
headers: { Authorization: `Bot ${token}` }
}).then(r => r.json());
const modRole = roles.find(r => r.name === 'Mod');
const modPerms = BigInt(modRole.permissions);
General Permissions
| Name | Value | Bit | Description |
CREATE_INSTANT_INVITE | 1 | 0 | Create invite links for the server |
KICK_MEMBERS | 2 | 1 | Remove members from the server |
BAN_MEMBERS | 4 | 2 | Permanently ban members |
ADMINISTRATOR | 8 | 3 | Grants all permissions; bypasses channel overrides. Assign with care. |
MANAGE_CHANNELS | 16 | 4 | Create, edit, and delete channels and categories |
MANAGE_GUILD | 32 | 5 | Edit server settings (name, icon, etc.) |
ADD_REACTIONS | 64 | 6 | Add emoji reactions to messages |
VIEW_AUDIT_LOG | 128 | 7 | View the server audit log |
PRIORITY_SPEAKER | 256 | 8 | Reduces others' volume when speaking in voice |
STREAM | 512 | 9 | Share screen / stream in voice channels |
Text Channel Permissions
| Name | Value | Bit | Description |
VIEW_CHANNEL | 1024 | 10 | See the channel in the list and read its messages |
SEND_MESSAGES | 2048 | 11 | Post messages in text channels |
MANAGE_MESSAGES | 8192 | 13 | Delete others' messages; pin and unpin messages |
EMBED_LINKS | 16384 | 14 | URLs in messages generate link preview cards |
ATTACH_FILES | 32768 | 15 | Upload files as message attachments |
READ_MESSAGE_HISTORY | 65536 | 16 | Load message history; scroll up in channels |
MENTION_EVERYONE | 131072 | 17 | Send @everyone and @here mentions |
USE_EXTERNAL_EMOJIS | 262144 | 18 | Use custom emojis from other servers |
Voice Channel Permissions
| Name | Value | Bit | Description |
CONNECT | 1048576 | 20 | Join voice channels |
SPEAK | 2097152 | 21 | Transmit audio in voice channels |
MUTE_MEMBERS | 4194304 | 22 | Server-mute other members in voice |
DEAFEN_MEMBERS | 8388608 | 23 | Server-deafen other members in voice |
MOVE_MEMBERS | 16777216 | 24 | Move members between voice channels |
USE_VAD | 33554432 | 25 | Use voice activity detection (no push-to-talk required) |
Nickname Permissions
| Name | Value | Bit | Description |
CHANGE_NICKNAME | 67108864 | 26 | Change your own nickname in this server |
MANAGE_NICKNAMES | 134217728 | 27 | Change other members' nicknames |
Server Management
| Name | Value | Bit | Description |
MANAGE_ROLES | 268435456 | 28 | Create, edit, and delete roles; assign roles to members |
MANAGE_WEBHOOKS | 536870912 | 29 | Create and manage incoming webhooks |
MANAGE_GUILD_EXPRESSIONS | 1073741824 | 30 | Upload and delete custom emojis |
USE_APPLICATION_COMMANDS | 2147483648 | 31 | Use bot slash commands in this server |
REQUEST_TO_SPEAK | 4294967296 | 32 | Request to speak in Stage channels |
MANAGE_EVENTS | 8589934592 | 33 | Create and manage scheduled events |
Thread Permissions
| Name | Value | Bit | Description |
MANAGE_THREADS | 17179869184 | 34 | Delete and archive threads; rename threads |
CREATE_PUBLIC_THREADS | 34359738368 | 35 | Create public threads inside forum channels |
CREATE_PRIVATE_THREADS | 68719476736 | 36 | Create private (invite-only) threads |
SEND_MESSAGES_IN_THREADS | 274877906944 | 38 | Send messages in existing threads |
Moderation
| Name | Value | Bit | Description |
MODERATE_MEMBERS | 1099511627776 | 40 | Timeout members (temporarily restrict messaging) |
Quick Reference — All Flags
const PERMISSIONS = {
CREATE_INSTANT_INVITE: 1n,
KICK_MEMBERS: 2n,
BAN_MEMBERS: 4n,
ADMINISTRATOR: 8n,
MANAGE_CHANNELS: 16n,
MANAGE_GUILD: 32n,
ADD_REACTIONS: 64n,
VIEW_AUDIT_LOG: 128n,
PRIORITY_SPEAKER: 256n,
STREAM: 512n,
VIEW_CHANNEL: 1024n,
SEND_MESSAGES: 2048n,
MANAGE_MESSAGES: 8192n,
EMBED_LINKS: 16384n,
ATTACH_FILES: 32768n,
READ_MESSAGE_HISTORY: 65536n,
MENTION_EVERYONE: 131072n,
USE_EXTERNAL_EMOJIS: 262144n,
CONNECT: 1048576n,
SPEAK: 2097152n,
MUTE_MEMBERS: 4194304n,
DEAFEN_MEMBERS: 8388608n,
MOVE_MEMBERS: 16777216n,
USE_VAD: 33554432n,
CHANGE_NICKNAME: 67108864n,
MANAGE_NICKNAMES: 134217728n,
MANAGE_ROLES: 268435456n,
MANAGE_WEBHOOKS: 536870912n,
MANAGE_GUILD_EXPRESSIONS: 1073741824n,
USE_APPLICATION_COMMANDS: 2147483648n,
REQUEST_TO_SPEAK: 4294967296n,
MANAGE_EVENTS: 8589934592n,
MANAGE_THREADS: 17179869184n,
CREATE_PUBLIC_THREADS: 34359738368n,
CREATE_PRIVATE_THREADS: 68719476736n,
SEND_MESSAGES_IN_THREADS: 274877906944n,
MODERATE_MEMBERS: 1099511627776n,
};