> 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/infraction.md).

# Infractions plugin

Infraction tracking and moderation commands for Dreamliner.

## Commands

### Punishment commands

| Command    | Permission    | Description                                                 |
| ---------- | ------------- | ----------------------------------------------------------- |
| `/warn`    | `can_warn`    | Issue a warning                                             |
| `/note`    | `can_note`    | Add a staff note                                            |
| `/mute`    | `can_mute`    | Timeout a member via Discord (requires `duration`, max 28d) |
| `/unmute`  | `can_mute`    | Clear a member's Discord timeout                            |
| `/kick`    | `can_kick`    | Kick a member                                               |
| `/ban`     | `can_ban`     | Permanently ban a member                                    |
| `/tempban` | `can_ban`     | Temporarily ban a member                                    |
| `/unban`   | `can_unban`   | Unban by user ID                                            |
| `/softban` | `can_softban` | Ban and immediately unban to purge messages                 |

### Case management

| Command                | Permission          | Description                                 |
| ---------------------- | ------------------- | ------------------------------------------- |
| `/infraction view`     | `can_view`          | View infraction details by ID               |
| `/infraction search`   | `can_view`          | Search by ID, user, mod, or reason text     |
| `/infraction reason`   | `can_edit_reason`   | Edit an infraction reason                   |
| `/infraction duration` | `can_edit_duration` | Extend or set duration (from creation time) |
| `/infraction delete`   | `can_delete`        | Delete an infraction record                 |

## Configuration

```yaml
plugins:
  infractions:
    config:
      mute_role: "1234567890123456789"      # Optional legacy; /mute uses Discord timeout instead
      case_log_channel: "1234567890123456789"  # Optional; falls back to moderation_log_channel_id
      confirm_actions: true
      ban_delete_message_days: 0
      softban_delete_message_days: 7
      reason_edit_level: 100
      duration_edit_level: 100
      notify:
        warn:
          dm: true
        mute:
          dm: false
    overrides:
      - level: ">=50"
        config:
          can_warn: true
          can_mute: true
          can_view: true
```

## Duration format

Timed actions use Dreamliner duration formats: `30s`, `5m`, `2h`, `1d`, `1w`.

## Expiration

Timed mutes and bans are checked every minute. When a tempmute or tempban expires, the bot removes the mute role or unbans the user and marks the infraction inactive.

Manual unmute/unban or removing the mute role also clears active infraction records.

## Case log

When `case_log_channel` (or the server `moderation_log_channel_id`) is set, each action posts a log line to that channel. Case updates, deletions, and expirations are also logged there.


---

# 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/infraction.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.
