For developers · 3 min read
Slash commands and default_member_permissions
Control who can use a command without giving your bot anything extra.
Replying to a slash command does not need any channel permission. That means many utility bots can be invited with permissions=0 and still work.
To restrict who can use a command, set default_member_permissions when you register it. Only members with those permissions see the command by default, and server admins can adjust it under Integrations.
json
{
"name": "ban",
"description": "Ban a member",
"default_member_permissions": "4"
}Still check permissions in your handler
default_member_permissions is a default that admins can override. For destructive commands, also check the invoking member's permissions in code.