> ## Documentation Index
> Fetch the complete documentation index at: https://docs.razebot.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Moderation

> Set up raze's moderation systems — jail, manager approval, mod roles, owner notifications, and invoke messages.

# Moderation

> Set up raze's moderation systems — jail, manager approval, mod roles, owner notifications, and invoke messages.

## Overview

raze's moderation toolkit covers bans, kicks, timeouts, warnings, purges, role management, lockdowns, and more. Most commands work out of the box — no setup needed. This page covers the systems that require configuration: jail and invoke messages.

## Jail Setup

Jail removes all of a member's roles and locks them in a dedicated channel until a moderator unjails them. Their roles are saved and fully restored on unjail.

<Steps>
  <Step title="Run the setup command">
    ```bash theme={null} theme={null}
    ;jail setup
    ```

    Automatically creates a `Jailed` role and `#jail` channel with the correct permissions.
  </Step>

  <Step title="Jail a member">
    <CodeGroup>
      ```bash Syntax theme={null} theme={null}
      ;jail (@member) [reason]
      ```

      ```bash Example theme={null} theme={null}
      ;jail @wanderer spamming in general
      ```
    </CodeGroup>

    All roles are stripped and the `Jailed` role is applied.
  </Step>

  <Step title="Unjail a member">
    <CodeGroup>
      ```bash Syntax theme={null} theme={null}
      ;unjail (@member) [reason]
      ```

      ```bash Example theme={null} theme={null}
      ;unjail @wanderer served their time
      ```
    </CodeGroup>

    The jail role is removed and all original roles are restored.
  </Step>
</Steps>

### Manual configuration

If you'd rather use an existing role or channel instead of running `;jail setup`:

<Expandable title="Set the jail role">
  <CodeGroup>
    ```bash Syntax theme={null} theme={null}
    ;jail role (@role)
    ```

    ```bash Example theme={null} theme={null}
    ;jail role @Jailed
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Set the jail channel">
  <CodeGroup>
    ```bash Syntax theme={null} theme={null}
    ;jail channel (#channel)
    ```

    ```bash Example theme={null} theme={null}
    ;jail channel #jail
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Set the jail message">
  <CodeGroup>
    ```bash Syntax theme={null} theme={null}
    ;jail message (text or embed code)
    ```

    ```bash Example theme={null} theme={null}
    ;jail message {user.mention} you have been jailed for: {reason}
    ```
  </CodeGroup>

  Supports variables like `{user.mention}`, `{reason}`, and `{moderator.mention}`.
</Expandable>

<Expandable title="View configuration">
  ```bash theme={null} theme={null}
  ;jail config
  ```
</Expandable>

## Setting Staff Roles

Use [Fake Permissions](/security/fakepermissions) to grant moderation access to a role without giving Discord permissions. Staff will be able to use raze's moderation commands only.

## Invoke Messages

Customize the response raze sends when a moderation action is taken, and optionally send a DM to the punished member.

<Expandable title="Set invoke message or DM">
  <CodeGroup>
    ```bash Syntax theme={null} theme={null}
    ;invoke (command) message (embed code)
        ;invoke (command) dm (embed code)
    ```

    ```bash Example theme={null} theme={null}
    ;invoke ban message {embed}$v{description: {member} was banned for {reason}}
        ;invoke ban dm {embed}$v{description: You were banned from {guild} for {reason}}
    ```
  </CodeGroup>

  Supported commands: `ban`, `unban`, `kick`, `timeout`, `untimeout`, `jail`, `unjail`, `hardban`, `softban`, `warn`
</Expandable>

<Info>
  The `message` parameter accepts raw text or a full embed code with dynamic variables. See the [Invoke](/server-config/invoke) page for all available variables and detailed setup.
</Info>

## Manager

When a manager is configured and enabled, every moderation action (ban, kick, timeout, tempban, softban, warn) is **paused** before it executes. The manager receives a DM with an **Approve** or **Reject** button.

* **Approve** — the action executes immediately.
* **Reject** — the action is cancelled and the moderator is notified in the original channel.

If the manager cannot be DM'd, the action proceeds without waiting for approval.

<Steps>
  <Step title="Set the manager">
    <CodeGroup>
      ```bash Syntax theme={null} theme={null}
      ;manager set (@member)
      ```

      ```bash Example theme={null} theme={null}
      ;manager set @wanderer
      ```
    </CodeGroup>

    Sets the member who will receive approval DMs and enables approval immediately.
  </Step>

  <Step title="Toggle on or off">
    ```bash theme={null} theme={null}
    ;manager toggle
    ```

    Enables or disables the approval requirement without removing the configured manager.
  </Step>
</Steps>

<Expandable title="Remove the manager">
  ```bash theme={null} theme={null}
  ;manager remove
  ```
</Expandable>

<Expandable title="View current configuration">
  ```bash theme={null} theme={null}
  ;manager
  ```
</Expandable>

<Warning>
  Requires `Administrator` permission or a raze fake-permission grant.
</Warning>

***

## Notifier

When enabled, the server owner receives a DM every time a moderation action is taken — regardless of who ran the command.

Covers: `ban`, `unban`, `kick`, `timeout`, `untimeout`, `tempban`, `softban`, `warn`

```bash theme={null} theme={null}
;notifier toggle
```

Run again to disable. The owner is never notified if they are the one running the command.

<Expandable title="View current state">
  ```bash theme={null} theme={null}
  ;notifier
  ```
</Expandable>

<Warning>
  Requires `Administrator` permission or a raze fake-permission grant.
</Warning>

***

## Mod Roles

Mod roles let a role use moderation commands even when members lack the underlying Discord permission **and** are not above the target in the role hierarchy. Useful for giving lower staff the ability to moderate members at the same tier without promoting them in Discord's role list.

Mod roles can be scoped to specific commands. A role with no command scope can use **all** mod commands.

<Steps>
  <Step title="Add a mod role (all commands)">
    <CodeGroup>
      ```bash Syntax theme={null} theme={null}
      ;modrole add (@role)
      ```

      ```bash Example theme={null} theme={null}
      ;modrole add @Moderator
      ```
    </CodeGroup>
  </Step>

  <Step title="Add a mod role scoped to specific commands">
    <CodeGroup>
      ```bash Syntax theme={null} theme={null}
      ;modrole add (@role) (command) [command ...]
      ```

      ```bash Example — higher mods can ban and kick theme={null} theme={null}
      ;modrole add @Senior Mod ban kick
      ```

      ```bash Example — trial mods can only timeout theme={null} theme={null}
      ;modrole add @Trial Mod timeout mute
      ```
    </CodeGroup>
  </Step>
</Steps>

**Valid command names:** `ban`, `hardban`, `kick`, `mute`, `softban`, `tempban`, `timeout`, `untimeout`, `unmute`, `warn`

<Note>
  `mute` and `unmute` are aliases for `timeout` and `untimeout`.
</Note>

<Expandable title="Remove a mod role">
  <CodeGroup>
    ```bash Syntax theme={null} theme={null}
    ;modrole remove (@role)
    ```

    ```bash Example theme={null} theme={null}
    ;modrole remove @Trial Mod
    ```
  </CodeGroup>
</Expandable>

<Expandable title="List all mod roles">
  ```bash theme={null} theme={null}
  ;modrole
  ```
</Expandable>

<Warning>
  Requires `Administrator` permission or a raze fake-permission grant.
</Warning>
