👥

Application Command Permissions

Control who can see and use your slash commands. Set default member permissions, DM availability, and age restrictions for your Discord bot commands.

Application Command Permissions - Control who can see and use your slash commands. Set default permissions, DM availability, and manage role/user-specific access.

Important: Discord has deprecated programmatic command permission management. Command permissions are now managed through Discord's Server Settings → Integrations UI. This tool helps you set default_member_permissions which controls the base requirement to see commands.

Quick Presets

Command Configuration

Lowercase, alphanumeric, dashes, and underscores only (1-32 characters)

19/100 characters

Members need this permission to see and use the command by default

Permission Overwrites (Legacy)

Note: Managed through Discord UI now, but included for reference

No permission overwrites added. Click "Add Overwrite" to create role/user-specific permissions.

// Method 1: Define command with permissions in the command builder
const command = new SlashCommandBuilder()
  .setName('moderate')
  .setDescription('Moderation commands')
  .setDefaultMemberPermissions(PermissionFlagsBits.ManageRoles)
  .setDMPermission(false)
  ;

// Method 2: Register command with REST API
const commands = [{
  name: 'moderate',
  description: 'Moderation commands',
  default_member_permissions: '268435456',
  dm_permission: false,
  
}];

await rest.put(
  Routes.applicationGuildCommands(clientId, guildId),
  { body: commands }
);


// Command execution with permission checks
client.on('interactionCreate', async interaction => {
  if (!interaction.isChatInputCommand()) return;
  if (interaction.commandName !== 'moderate') return;

  // Permissions are automatically checked by Discord
  // Only users/roles with proper permissions can see/use the command

  await interaction.reply('Command executed!');
});

Understanding Application Command Permissions

Important Discord API Changes

As of April 2022, Discord deprecated the ability to programmatically manage command permissions (allow/deny specific roles or users from using commands).

What this means:

  • Command permissions are now managed through Server Settings → Integrations in the Discord UI
  • You can still set default_member_permissions to control who sees commands by default
  • Server admins can then customize permissions per command through Discord's interface
  • The old API methods for setting permissions have been removed

This tool focuses on setting default_member_permissions, which is still supported and recommended.

What are Default Member Permissions?

Default member permissions set the baseline requirement for users to see and use a slash command. If a user doesn't have the specified permission, the command won't appear in their slash command menu.

Key Features:

  • Visibility Control: Users without the permission can't see the command
  • Server Overrideable: Server admins can customize permissions in Settings → Integrations
  • Single Permission: You can only set one permission as the requirement
  • Null = Everyone: Setting to null (0) means everyone can use the command

Command Permission Options

default_member_permissions

The permission required to see and use the command by default.

null: Everyone can use
8: Administrator only
Custom: Specific permission

dm_permission

Whether the command can be used in direct messages with the bot.

true: Can be used in DMs
false: Guild only

nsfw

Whether the command is age-restricted (18+) and only usable in NSFW channels.

true: NSFW channels only
false: All channels

guild_only (Discord.py)

Decorator that makes a command guild-only (same as dm_permission: false).

@app_commands.guild_only()

Common Permission Values

Permission Value Use Case
None (Everyone) null or 0 Public commands anyone can use
Administrator 8 Admin-only configuration commands
Manage Guild 32 Server management commands
Kick Members 2 Moderation commands (kick)
Ban Members 4 Moderation commands (ban)
Moderate Members 1099511627776 Timeout and voice moderation
Manage Messages 8192 Message cleanup commands
Manage Channels 16 Channel management commands

How Server Admins Customize Permissions

Server administrators can override your default permissions and customize command access for their server through Discord's interface.

Steps for Server Admins:

1

Open Server Settings → Integrations

2

Click on your bot's name

3

Click "Manage" next to any command

4

Add/remove roles and users, or change the default permission requirement

Best Practices

Set Appropriate Default Permissions

Choose a permission that matches the command's purpose. Moderation commands should require moderation permissions.

Use null for Public Commands

Set default_member_permissions to null (0) for commands that everyone should be able to use.

Disable DM for Guild-Specific Commands

Commands that interact with server features (moderation, roles, channels) should have dm_permission set to false.

Mark NSFW Content Appropriately

Always set nsfw: true for commands that return age-restricted content to comply with Discord's ToS.

Document Permission Requirements

Clearly document what permissions your commands require in your bot's documentation or help commands.

Trust Server Admins

Remember that server admins can override your defaults. Set sensible defaults and let them customize as needed.

Important Notes

  • Programmatic command permission management (allow/deny APIs) was deprecated in April 2022
  • Command permissions are now managed through Discord's UI by server administrators
  • default_member_permissions only sets the initial requirement - admins can override it
  • You can only set ONE permission as the default requirement (not multiple)
  • Server administrators with Administrator permission bypass all command permission checks
  • NSFW commands cannot be used in non-NSFW channels, even by administrators