> For the complete documentation index, see [llms.txt](https://dreamliner.gitbook.io/dreamliner-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dreamliner.gitbook.io/dreamliner-docs/docs/plugins/automod.md).

# Automod plugin

Automatic moderation for duplicate messages, rate limits, and join raids. Dreamliner evaluates messages and member joins against configurable rules and takes action when thresholds are exceeded.

**Automod is disabled by default.** Enable it when you're ready with `/plugin toggle plugin:automod state:Enable`. Rule defaults are preconfigured in the template so you can turn it on without extra setup.

## Configuration

```yaml
plugins:
  automod:
    enabled: false
    config:
      enabled_rules:
        - duplicate
        - rate_limit
      duplicate_window_ms: 30000
      duplicate_max: 3
      rate_limit_count: 5
      rate_limit_window_ms: 10000
      raid_join_count: 10
      raid_join_window_ms: 30000
      ignored_channels: []
      ignored_roles: []
      action: delete
      mute_duration_ms: 600000
    overrides:
      - level: ">=50"
        config:
          can_status: true
          can_test: true
          can_configure: true
```

| Field                  | Description                                                             |
| ---------------------- | ----------------------------------------------------------------------- |
| `enabled`              | Master switch (`false` by default). Use `/plugin toggle` or set in YAML |
| `enabled_rules`        | Active rule types: `duplicate`, `rate_limit`, `raid`                    |
| `duplicate_window_ms`  | Time window for duplicate detection                                     |
| `duplicate_max`        | Max identical messages in the window                                    |
| `rate_limit_count`     | Max messages allowed in the rate-limit window                           |
| `rate_limit_window_ms` | Rate-limit time window                                                  |
| `raid_join_count`      | Joins that trigger raid detection                                       |
| `raid_join_window_ms`  | Raid detection time window                                              |
| `ignored_channels`     | Channel IDs excluded from automod                                       |
| `ignored_roles`        | Role IDs excluded from automod                                          |
| `action`               | `delete`, `warn`, or `mute` when a rule triggers                        |
| `mute_duration_ms`     | Mute duration when action is `mute`                                     |
| `log_channel_id`       | Optional override; defaults to server `moderation_log_channel_id`       |

Automod actions and raid alerts are logged to `moderation_log_channel_id` using the same format as other moderation logs.

## Commands

| Command                   | Permission      | Description                           |
| ------------------------- | --------------- | ------------------------------------- |
| `/automod status`         | `can_status`    | Show current automod settings         |
| `/automod test`           | `can_test`      | Test sample text against active rules |
| `/automod configure`      | `can_configure` | Update common automod settings        |
| `/automod ignore-channel` | `can_configure` | Ignore or un-ignore a channel         |
| `/automod ignore-role`    | `can_configure` | Ignore or un-ignore a role            |

## Requirements

* For `mute` action, the bot applies a Discord timeout using `mute_duration_ms` (defaults to 10 minutes if unset).
* Members with ignored roles are skipped.
* Bot messages are not checked.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://dreamliner.gitbook.io/dreamliner-docs/docs/plugins/automod.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
