BotManualTHE COMMUNITY PLAYBOOK
English

Rules as Code: setup and everyday use

Structured, numbered, versioned server rules: published as embeds, re-acceptance on major changes, cited in moderation.

3 min read
On this page

What this feature does

Numbered server rules with versions, diffs, re-acceptance and rule citations in every moderation case.

Before you begin

For server settings, open your server dashboard and select the server you manage. For commands and buttons, use the server where your community has enabled this feature. The options available to a member depend on that server’s settings.

Get started

1. Enable Rules as Code

Open your server dashboard, choose your server and switch on Rules as Code in the Moderation section.

2. Write your rules

Add sections and rules in the editor with a severity and a suggested action for each. The draft saves itself and a live preview shows the Discord embeds in your bot language.

3. Publish a version

Pick the rules channel and press Publish. The dialog shows the diff and suggests a major or minor version; add a short note for the history.

4. Use them every day

Members read the rules in the channel or with /rule, accept them with the button, and moderators cite them with the rule: option.

Rules that stay readable and up to date

Each rule gets a number from its place in the document, so “rule 3.2” always means the same thing to members and moderators. Rules keep a stable identity behind the scenes, so diffs and moderation stats still follow a rule after you move or rename it. You can show the severity and the suggested action to members, or keep them for staff only.

The rules document holds up to 30 rules on the Free plan and 200 on Pro, in up to 25 sections. Verification can use the published rules in its rules step, and accepting there counts as accepting here.

  • /rule number [private]: show one rule by its number or title
  • rule: option on /warn, /timeout, /kick and /ban: cite the broken rule

Moderation that points to the rule

When a moderator picks a rule, the case remembers the rule and the version it belonged to. Without a typed reason, the reason becomes “Rule 3.2: No spam”. The mod log shows a Rule field, and the member’s DM can quote the rule’s title and text, which makes appeals easier to judge and arguments shorter.

Questions and troubleshooting

How do I make a rules channel on Discord with a bot?

Enable Rules as Code in your server dashboard, write your sections and rules in the editor, choose a rules channel and press Publish. The bot posts the rules as embeds and keeps them updated whenever you publish a new version.

Can members accept the rules to get a role?

Yes. Turn on acceptance to add an “I accept the rules” button that can give a role. With re-acceptance on, a new major version takes the role back from members until they accept the new rules.

What is the difference between a major and a minor version?

A minor version (2.0 → 2.1) is a small fix, such as a typo. A major version (2.1 → 3.0) is a real change and can ask members to accept again. The publish dialog suggests major when rules were added, removed, reworded or re-rated.

How do moderators cite a rule?

Use the rule: option on /warn, /timeout, /kick or /ban. It autocompletes from the published rules, for example “3.2 No spam · ⚖️ Warn”. The case, mod log and member DM then show that rule.

How many rules can I write?

Up to 30 rules on the Free plan and 200 on Pro, in up to 25 sections. See pricing.

Next steps

Use the command reference below for the available Discord actions. If something does not appear or respond, follow Troubleshooting. Server admins can check roles and permissions before changing access.

Commands for this feature

CommandWhat it doesOptions
/ruleShow one of the server rulesnumber requiredRule number (e.g. 3.2) or titleText · Up to 100 characters · Choose from the matching suggestionsprivate optionalOnly show it to meYes / no

Find an answer

Search features, commands and the full text of every guide.

Start typing to find a guide.

Browse all guides