Overview
Command restrictions let you lock a command so it can only be used:- by members with a specific role, or
- inside a specific channel
Restricting a command
Userestrictcommand:
How it behaves
- If you restrict to a role, only members with that role can run the command.
- If you restrict to a channel, the command can only be used in that channel.
- One restriction is stored per command (role or channel).
Viewing restricted commands
Use:Removing a restriction
Useunrestrictcommand:
Protected commands
Some commands are “protected” and cannot be restricted/unrestricted to avoid soft-locking critical bot management. If you try to restrict one of these, the bot will deny the action.Troubleshooting
“unauthorized” / “missing permission”
Only the bot owner can manage restrictions. Make sure you’re using the owner account.“The command … does not exist”
Use the command’s real name (or its qualified name for subcommands).A restricted command still runs
Check:- you restricted the correct command name (e.g., the qualified name),
- the restriction list shows it, and
- your bot is running the restriction check in
setup_hook/ global checks.