Server · Concept

Command rules

Who may type what, and where. Two modes, two scopes, one cascade that settles it.

In short

With no rule at all, every command works everywhere. One rule changes that for a single command, a single channel, or the whole server at once.

A rule carries one of two modes: allow, or deny. It targets a command and takes effect the moment it is set, with no restart and no delay.

It also carries one of two scopes: the whole server, or a single channel. The channel is read first, so it always wins over the server.

The target is written in three ways: a command, one precise branch with its dot, or the wildcard that takes everything.

The bot reads eight rungs in a fixed order and stops at the first that answers. Deny before allow, channel before server: that order, and nothing else, decides.

1

Three ways to name a target

A rule first picks one of two scopes, then names what it targets. The server covers every channel; a channel covers only itself, and goes first.

guild
Server scope
Holds in every channel at once. This is the scope of a general policy, set once for the whole server.
channel
Channel scope
Holds only in the named channel, and comes before every server rule. With no channel given, it is the one the command was typed in.
SpellingExampleWhat it takes
One command petsThe command and all of its subcommands: a rule set on a parent flows down to every one of its branches.
One branch pets.listThat subcommand alone. The rest of the command is untouched, and the slash autocomplete offers every branch.
The wildcard * or allEvery command in the scope at once, but read after the ones naming a precise command.
  • The wildcard is written * or all: the 2 spellings are strictly equivalent.
2

Eight rungs, read in this order

The bot walks down the list and stops at the first rung that answers. If none answers, the command goes through.

01
Denied
A channel rule denies this command
02
Allowed
A channel rule allows this command
03
Denied
The channel denies the wildcard
04
Allowed
The channel allows the wildcard
05
Denied
A server rule denies this command
06
Allowed
A server rule allows this command
07
Denied
The server denies the wildcard
08
Allowed
The server allows the wildcard
Sudoer
Everything passes
An administrator who has typed sudo crosses the cascade without being read. Typing sudo again turns them back into an ordinary member.
Free commands
2 commands
sudo and commandrules are never blocked, otherwise a blanket deny would lock everyone out with no door back in.
No rule
Everything passes
A server with no rule at all does not read the cascade: every command is open in every channel.
  • One command can be targeted by several rules at once: the rung's rank, never the rule's date, is what settles it.
  • There are three situations that short-circuit the whole cascade, so a badly set deny never locks the server down.
3

Seven moves to keep the rules

One command, >commandrules, shortened to >cr, followed by the word below. Moderation means Administrator or Manage Messages; >sudo stands apart and asks for Administrator.

list Review. Lists every rule on the server, with a selector filtering on server, channel, or everything.
Moderation
allow Allow. Sets an allow. Scope and command are asked for; with no channel given, it is the one the command was typed in.
Moderation
deny Deny. Sets a deny, the same way. A rule already set identically is flagged rather than duplicated.
Moderation
reset guild Clear the server. Clears the server rules and leaves every channel rule in place.
Moderation
reset channel Clear a channel. Clears one channel's rules and leaves the server rules in place.
Moderation
reset all Clear everything. Clears everything at once and returns the server to its fresh state, where every command works everywhere.
Moderation
sudo Step over. Flips whoever types it into a sudoer, and back down on the second call. This is the escape door.
Administrator
  • There is no one-off deletion from Discord: a rule that gets in the way is cleared with a reset, then set again differently.

The commands

Manage command rules for the server · servers only

list List all command rules
allow Allow a command in a specific target
  • <target> The target to allow the command in
  • <command> The command to allow
  • [channel] The channel you want to allow the command in
deny Deny a command in a specific target
  • <target> The target to deny the command in
  • <command> The command to deny
  • [channel] The channel you want to deny the command in
reset Reset command rules

Allow administrators to bypass command rules in a server · servers only