Skip to main content

Managing Command Permissions by User or by Role

By default, users can run normal basic commands such as the work or crime command without any adjustments needed.

With the Manage Server permission, users can already run management commands that change the bot's configuration, such as the add-money command and are also able to add items to the store and change other bot settings. There are times when it is useful to be able to grant certain users or roles access to commands even if they do not have the Manage Server permission. Or, maybe you would like to blacklist a user or role from participating in the server economy. The information below will outline how you can do just that.

Managing command permissions is done with the permissions command. You need the Administrator permission to use it.

Permissions command
!permissions <deny | delete | allow | clear | list> <member or role> [command or module]

With this command, you can allow or disallow users/roles access to a command. You can also regulate access to entire modules with a single command. See https://unb.gg/commands for a list of modules and the commands in each module.


Allowing access to commands or modules​

Use the permissions command
!permissions allow <member or role> <command or module>

See below for an example of allowing a user to use the add-money command. Allow user add-money

See below for an example of allowing a role to use the fun module commands. Allow role fun module


Denying access to commands or modules​

Use the permissions command
!permissions deny <member or role> <command or module>

See below for an example of denying a user access to the work command. Deny user work command

See below for an example of denying a role access to the economy module commands. This means anyone with the role will be unable to use any command in the module. Deny role economy module


Viewing permissions currently set​

Use the permissions command
!permissions list <user or role>

Resetting a permission back to default​

You can remove an allowed/denied command or module that has been set.

Use the permissions command
!permissions delete <user or role> <command or module>

Resetting all permissions set for a user or role​

You can reset all permissions set for a user or role back to the default.

Use the permissions command
!permissions clear <user or role>

Additional considerations​

Allowing a command lets the member use it even if they don't have the Discord permission it normally needs. For example, allowing add-money lets a member add money without the Manage Server permission.

When permissions conflict, the most specific one wins. They are checked in this order, and the first match is used:

  1. A command set for the user
  2. A command set for one of their roles
  3. A module set for the user
  4. A module set for one of their roles

For example:

  • A user is allowed work, but one of their roles is denied work: they can use it, because user settings are checked first.
  • A role is denied work, but the user is allowed the income module: they can't use it, because command settings are checked before module settings.
  • One of a member's roles is allowed a command and another role is denied it: they can use it. Allow wins when both are at the same level.

Other things to know:

  • Denying a command blocks it even for members with Manage Server or Administrator.
  • These settings are ignored for the server owner.
  • They only apply to text commands. See Slash commands to manage slash commands.
  • Some commands check permissions themselves and can't be granted this way. For example, changing the prefix always needs Manage Server, and factory-reset can only be used by the server owner.