Server

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.

>commandrules
2 modes, allow or deny
3 scopes, channel, role or server
3 exits that get past the rules
2 wildcards accepted for a broad target
00

Overview

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.

01

Getting started

  1. List the rules

    Check what is already set before you add anything. A forgotten rule can block a command without you remembering it.

    >commandrules list
  2. Allow a command

    Give the command and its target: a channel, a role, or the whole server.

    >commandrules allow
  3. Deny a command

    A denial beats an allowance at the same level. Check the list again once it is set.

    >commandrules deny
02

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.

What it means

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.

03

Where a rule applies

Each rule targets a single level. The channel is the most specific, the server the widest.

The most specific
Channel

A channel rule applies only to that channel and comes before the role and the server.

For a group
Role

It applies to everyone who holds the role. It comes after the channel and before the server.

For everyone
Server

It covers every other case. It is the last level consulted.

04

Who decides

The channel is checked first, then the roles, then the server. The first rule that answers applies.

  1. 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
  2. 02
    Refusal

    Within one level, a refusal beats an approval.

    An approval and a refusal compete for the same level
  3. 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
05

What gets through anyway

3 cases bypass the rules.

Sudoer
Passes everywhere A sudoer ignores the rules, whatever the channel.
Free commands
2 commands sudo and commandrules always pass, so nobody gets locked out.
No rule
Everything is allowed If the server has no rule at all, every command runs.
06

Setting a rule

Reading, allowing or denying is all it takes.

Read See the state

>commandrules list shows the rules in force.

Allow Open

>commandrules allow opens the command for the server, a channel or a role.

Deny Close

>commandrules deny closes the command for the server, a channel or a role.

07

Undoing

From the most targeted to the widest.

  1. 01
    One channel

    Clears the rules of a single channel, the others stay.

    Rules of the other channels, roles and the server stay
  2. 02
    The server

    Clears the rules set at server level.

    Channels and roles keep their rules
  3. 03
    All

    Clears every rule on the server at once, channels and roles included.

    No rule is left
08

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

    sudo and commandrules never 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.

09

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.

FormExampleCovers
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
CommandEffect
>commandrulesManage command rules for the server
>commandrules listList all command rules
>commandrules allowAllow a command in a specific target
>commandrules denyDeny a command in a specific target
>commandrules resetReset command rules
>sudoAllow administrators to bypass command rules in a server
10

Going further

Rules touch two other systems. Each has its own page.

Custom roles

the roles players create

Server levels

what unlocks with activity

Each command has its own sheet, with its syntax. This page only explains why you type them.