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.
Lowercase, alphanumeric, dashes, and underscores only (1-32 characters)
19/100 characters
Members need this permission to see and use the command by default
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!');
});