Command rules
Without a single rule, every command works everywhere. One rule changes that for a command, a channel, a role or the whole server.
>commandrulesOverview
Without a rule, every command works everywhere, in every channel and for every member. A rule reserves a command for one specific place.
Use them to keep the bot quiet in chat channels and leave game commands where they belong.
Getting started
List the rules
Check what is already set before you add anything. A forgotten rule can block a command without you remembering it.
>commandrules listAllow a command
Give the command and its target: a channel, a role, or the whole server.
>commandrules allowDeny a command
A denial beats an allowance at the same level. Check the list again once it is set.
>commandrules deny
How it works
The bot checks the channel first, then the member's roles, then the server. The first rule that answers decides, and the later levels are not checked.
At the same level, a denial beats an allowance. A wildcard, * or all, targets a broad scope without naming each command.
The 2 free commands can never be blocked: sudo and commandrules. A bad rule therefore cannot stop you from fixing it.
One server rule is enough to close a command everywhere, and a channel rule reopens it wherever you want.
Since 3 exceptions bypass the rules, including the sudoer status, a closed command can still run for some members. Check who holds that status before you assume a command is closed.
Where a rule applies
Each rule targets a single level. The channel is the most specific, the server the widest.
A channel rule applies only to that channel and comes before the role and the server.
It applies to everyone who holds the role. It comes after the channel and before the server.
It covers every other case. It is the last level consulted.
Who decides
The channel is checked first, then the roles, then the server. The first rule that answers applies.
- 01 Named rule
A rule named after the command beats the wildcard of the same level.
A rule targets the command or one of its branches - 02 Refusal
Within one level, a refusal beats an approval.
An approval and a refusal compete for the same level - 03 Next level
If nothing answers at this level, we move up to the wider one. If no level answers, the command runs.
No rule targets the command at this level
What gets through anyway
3 cases bypass the rules.
- Sudoer
- Passes everywhere A sudoer ignores the rules, whatever the channel.
- Free commands
- 2 commands
sudoandcommandrulesalways pass, so nobody gets locked out. - No rule
- Everything is allowed If the server has no rule at all, every command runs.
Setting a rule
Reading, allowing or denying is all it takes.
>commandrules list shows the rules in force.
>commandrules allow opens the command for the server, a channel or a role.
>commandrules deny closes the command for the server, a channel or a role.
Undoing
From the most targeted to the widest.
- 01 One channel
Clears the rules of a single channel, the others stay.
Rules of the other channels, roles and the server stay - 02 The server
Clears the rules set at server level.
Channels and roles keep their rules - 03 All
Clears every rule on the server at once, channels and roles included.
No rule is left
Tips
- The channel wins
A channel rule goes before the role and the server. If a command stays blocked in one place only, check that channel first.
- Some commands stay free
sudoandcommandrulesnever get closed. You cannot lock yourself out of managing the rules. - The wildcard is broad
A
*rule targets a whole level at once. It also closes commands you did not have in mind.
Reference
The exact figures, open them when you need them.
The targets A rule targets a command, a branch or a wildcard.
The forms
The wildcard covers the whole level.
| Form | Example | Covers |
|---|---|---|
| Command | A whole command | The command and everything it contains |
| Branch | A specific branch, written with its dot | That branch and everything it contains |
| Wildcard | * or all | Every command of the level |
Commands
| Command | Effect |
|---|---|
>commandrules | Manage command rules for the server |
>commandrules list | List all command rules |
>commandrules allow | Allow a command in a specific target |
>commandrules deny | Deny a command in a specific target |
>commandrules reset | Reset command rules |
>sudo | Allow administrators to bypass command rules in a server |
Going further
Rules touch two other systems. Each has its own page.
the roles players create
what unlocks with activity