Your mission
A numbered rulebook with a tested acceptance role and an intentional major-version policy. This workshop uses a small first rollout so you can see the complete result before opening it to the whole community. The example is a starting recipe; keep your server's own rules and audience in mind when choosing the final values.
Step 1: Prepare your server
Open your server dashboard and select the correct server, then open Rules as Code. Enable the feature before running the example. Choose the rules channel and decide which sections should be visible to members. Draft short, specific rules that staff can cite consistently.
Read Roles and permissions if a destination or role cannot be selected. For channel-based actions, check permissions in the actual channel, including its category overrides. For automatic role changes, the bot needs Manage Roles and a position above the role it will assign. Only grant the permissions needed by your chosen workflow.
Step 2: Build your first working example
1. Create sections and rules
Give each rule a clear title, explanation and severity. Decide whether suggested moderation actions are public; staff visibility and member visibility are different.
2. Publish and accept
Review the draft, publish it and test the acceptance button if enabled. Choose an ordinary acceptance role below the bot and verify the private confirmation.
3. Handle changes deliberately
A major change can require re-acceptance and remove the acceptance role if configured. Review that effect before publishing a major revision; a punctuation edit should not accidentally reopen onboarding for everyone.
After changing the server-wide settings, use Save changes. An item editor, draft, preview or test action is a separate part of the workflow: read its save or publish action before expecting a public Discord post. Reopen the saved item to confirm the destination, access rules and values you intended.
Step 3: Understand the settings
Initial values below describe a new configuration. Your server may already have different saved values. A field with no initial value is chosen in its editor. Optional sections can stay inactive until the basic setup works. Empty and zero do not have one universal meaning; use the explanation for that specific field.
General
| Setting | Initial value | What it changes and how to use it |
|---|---|---|
| Channel | Not set | A read-only channel works best. the bot needs View Channel, Send Messages and Embed Links. |
| Embed colour | #9B6BFF | Appearance of this part of the card or interface. A color change does not change eligibility or permissions. |
| Show severity to members | On | A small 🟢🟡🟠🔴 line under each rule. |
| Show suggested actions to members | Off | E.g. “⚖️ Timeout 1 h”. Staff always see them when picking a rule. |
| Quote the rule in moderation DMs | On | The member’s DM shows “Rule 3.2 — title” and its text. |
| Major change by default | On | The Publish dialog starts with “Major change” on. |
Acceptance
| Setting | Initial value | What it changes and how to use it |
|---|---|---|
| Acceptance → Ask members to accept | Off | Records who accepted which version (stats + Flows trigger). |
| Acceptance → Button label | Not set | Text used for acceptance · button label. Check the preview and use only the variables offered by this editor. Up to 80 characters. |
| Acceptance → Role on acceptance | Not set | E.g. a role that unlocks the chat channels. |
| Acceptance → Remove the role after a major version | Off | Members who haven’t accepted the new major version lose the role until they do (removed gradually). |
| Acceptance · ephemeral confirm | On | Switch acceptance · ephemeral confirm on or off. This controls this option only; related options keep their own settings. |
Step 4: Configure the items inside this feature
Server-wide settings and individual entries serve different purposes. These tables describe the selected entry editors. Set up one complete entry first, save it, and confirm it works before adding the rest. Fields for an alternative type apply only when that type is selected.
Doc
| Setting | Initial value | What it changes and how to use it |
|---|---|---|
| Title | Not set | Text used for title. Check the preview and use only the variables offered by this editor. Up to 256 characters. |
| Intro | Not set | Set intro in the editor. Check it alongside the other fields in this section before saving. Up to 2000 characters. |
| Footer | Not set | Text used for footer. Check the preview and use only the variables offered by this editor. Up to 300 characters. |
| Sections | No entries | Add and edit entries individually. The fields for each entry are listed below; the list itself is not an on/off switch. up to 25 entries. |
| Sections entries · title | Choose in editor | Text used for sections entries · title. Check the preview and use only the variables offered by this editor. 1–100 characters. |
| Sections entries · emoji | Not set | Set sections entries · emoji in the editor. Check it alongside the other fields in this section before saving. Up to 64 characters. |
| Sections entries · description | Not set | Text used for sections entries · description. Check the preview and use only the variables offered by this editor. Up to 500 characters. |
| Sections entries · rules | No entries | Add and edit entries individually. The fields for each entry are listed below; the list itself is not an on/off switch. up to 30 entries. |
| Sections entries · rules entries · title | Choose in editor | Text used for sections entries · rules entries · title. Check the preview and use only the variables offered by this editor. 1–120 characters. |
| Sections entries · rules entries · text | Empty | Text used for sections entries · rules entries · text. Check the preview and use only the variables offered by this editor. Up to 1500 characters. |
| Sections entries · rules entries · severity | Not set | Choose how sections entries · rules entries · severity behaves from the supported options. Options: low, medium, high, critical. |
| Sections entries · rules entries · action · type | none | Choose how sections entries · rules entries · action · type behaves from the supported options. Options: none, warn, timeout, kick, ban. |
| Sections entries · rules entries · action · duration seconds | Not set | Duration of a time-limited action attached to this rule. For a timeout, 3,600 seconds is one hour; it does not set how long the rule itself remains in force. 60–2419200; whole numbers. |
Test the whole journey
- Accept the published rules as a member and verify the correct role is granted.
- Preview a revision and check its major-change and re-acceptance consequences before publishing.
- Repeat the relevant member action with an ordinary member account and the staff action with your intended staff role. An administrator test alone can hide permission restrictions. Check both the response in Discord and the saved record or result in the dashboard.
- Change one setting that affects the result, save it, and repeat the same test. Record the previous value so you can restore it if the new behavior is not what you wanted.
Follow the complete workflow
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.
Operation and behavior in detail
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 titlerule:option on/warn,/timeout,/kickand/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.
When something looks wrong
| Symptom | What to inspect | How to recover |
|---|---|---|
| Members unexpectedly lose the acceptance role | Major revision choice and remove-on-major setting. | Explain the new acceptance requirement or correct the publication policy before another revision. |
| The saved setup produces no visible result | Whether the feature is enabled, the required action has actually happened, and the selected destination still exists. | Follow the worked example once, then inspect the response before retrying. A saved configuration alone does not perform every action. |
| Staff can use it, but an ordinary member cannot | Member eligibility, selected roles, channel overrides and Discord command permissions. | Test with the affected role combination. Correct the specific restriction and test again. |
| A role, reward or message is missing | The related feature, destination permissions and the result of the original action. | Confirm what already completed before repeating an action that spends currency, sends a message or grants a reward. |
Feature-specific questions
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.
Launch checklist
- Accept the published rules as a member and verify the correct role is granted.
- Preview a revision and check its major-change and re-acceptance consequences before publishing.
- The saved setup and the actual Discord result match the example you chose.
- A regular member and the intended staff role can complete their respective steps.
- Optional rewards, notifications and public destinations are intentional.
- Another admin knows which settings to change, how to inspect a result and how to stop or correct the workflow.
Share Rules as Code basics with someone who needs an overview. Use the command reference below for exact command names and required options.
Commands for this feature
| Command | What it does | Options |
|---|---|---|
/rule | Show one of the server rules | number requiredRule number (e.g. 3.2) or titleText · Up to 100 characters · Choose from the matching suggestionsprivate optionalOnly show it to meYes / no |