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

# Channel moderation

> Lock or restore channels, configure slowmode, apply server lockdown, and review the channel-recreation command's limitations.

Headless provides four separate workflows: lock/unlock for one text channel, slowmode to limit message frequency, lockdown to restrict multiple server destinations, and nuke to recreate the current text channel. Moderation changes create cases and log entries where supported. Confirm permissions, scope, and recovery before editing overwrites.

## Lock and restore a channel

`.lock [#channel] [reason]` (aliases `.lk`, `.l`) and `/lock` block the current or selected text channel. `.unlock [#channel] [reason]` (aliases `.ulk`, `.u`) and `/unlock` restore access. When a prefix command runs inside a thread, the callback operates on its parent text channel.

The actor and Headless need `Manage Roles`; Fake Permissions may satisfy the compatible actor check, but the bot needs its native permission and must be able to edit the channel's overwrites. The first `.lock` stores the original `@everyone` overwrite per server. It denies sending messages, adding reactions, and creating public or private threads. Repeated locks do not replace the saved snapshot. Each lock and unlock creates its own case and log event.

If a snapshot exists, `.unlock` restores the saved `@everyone` overwrite exactly. Without one, it removes explicit lock values so Discord can recalculate inherited access. It does not restore overwrites for other roles; an inherited category lock can still deny access after unlock.

### `.lock`

```headless-command Syntax theme={null}
.lock [channel] [reason=Sin razón]
```

```headless-command Example theme={null}
.lock #general raid detected
```

### `.unlock`

```headless-command Syntax theme={null}
.unlock [channel] [reason=Sin razón]
```

```headless-command Example theme={null}
.unlock #general access restored
```

### `.lock`

```headless-command Syntax theme={null}
/lock [channel:<channel>] [reason:<reason>]
```

```headless-command Example theme={null}
/lock channel:#general reason:raid detected
```

### `.unlock`

```headless-command Syntax theme={null}
/unlock [channel:<channel>] [reason:<reason>]
```

```headless-command Example theme={null}
/unlock channel:#general reason:access restored
```

## Slowmode

`.slowmode [#channel] <duration> [reason]` (aliases `.slow`, `.sm`) changes the interval in the current or selected channel. Prefix accepts seconds or `s`, `m`, and `h` suffixes, plus `off` or `0` to disable it. The maximum is 21,600 seconds (six hours). `/slowmode` accepts the channel, `seconds` as an integer from 0 to 21,600, and a reason; slash does not accept unit suffixes.

The actor needs `Manage Channels` (native or a compatible Fake Permission), and Headless needs its own native `Manage Channels` permission. Each change records the old and new values in a case and log. Slowmode only limits message frequency; it does not delete messages or lock the channel.

### `.slowmode`

```headless-command Syntax theme={null}
.slowmode [first=0] [second] [reason]
```

```headless-command Example theme={null}
.slowmode 15
```

Also works: `.slowmode #general 10m flood` · `.slowmode #general off`

### `.slowmode`

```headless-command Syntax theme={null}
/slowmode [channel:<channel>] [seconds:<seconds>] [reason:<reason>]
```

```headless-command Example theme={null}
/slowmode channel:#general seconds:600 reason:flood
```

**Note:** Slash slowmode always uses an integer number of seconds. For example, `10m` in prefix equals `seconds: 600` in slash. `.lockdown` and `.endlockdown` are prefix-only.

## Lockdown across multiple channels

`.lockdown [reason]` (alias `.ld`) and `.endlockdown` (aliases `.eld`, `.elock`) are prefix-only; there is no slash equivalent. Lockdown iterates available categories, text channels, voice channels, Stage channels, and forums. The actor needs `Administrator` (native or a compatible Fake Permission); Headless needs native `Manage Channels`.

Dashboard → Lockdown can configure up to 80 allowed roles. Before changing a destination, Headless persists its previous `@everyone` overwrite and the overwrites for those allowed roles. It then denies `@everyone` sending messages, adding reactions, creating threads, connecting, speaking, and streaming; allowed roles receive explicit participation overwrites. A failure on one destination does not stop the rest, and the case/log record successful and failed targets. Configuration and snapshots are server-scoped. Starting another lockdown while one is active or still has snapshots pending is refused so the original permission baseline cannot be overwritten.

`.endlockdown` attempts to restore `@everyone` and allowed roles that still exist. Other role overwrites are neither saved nor restored. If Discord rejects a restoration, Headless keeps the original snapshots only for the failed destinations, leaves lockdown active, and reports that recovery is pending. Resolve the permission or role-hierarchy issue, then run `.endlockdown` again; snapshots are cleared only after all remaining destinations are restored. Deleted destinations are skipped because there is no channel left to update.

### `.lockdown`

```headless-command Syntax theme={null}
.lockdown [reason=Emergency lockdown]
```

```headless-command Example theme={null}
.lockdown raid detected
```

### `.endlockdown`

```headless-command Syntax theme={null}
.endlockdown
```

```headless-command Example theme={null}
.endlockdown
```

## Recreate the current channel (nuke)

`.nuke [reason]` (aliases `.nk`, `.recreatechannel`, `.reiniciarcanal`) or `/nuke [reason]` recreates only the text channel where it is invoked. It does not accept a target channel. The command presents a confirmation and requires `Manage Channels` and Anti-Nuke Admin access; the server owner and Headless owner also pass that check. Administrator alone does not grant Anti-Nuke Admin access. Headless needs `Manage Channels`, `View Channel`, and `Send Messages`; the prefix command also requires the bot's `Manage Messages`. The account confirming must be the same one that started the action and must still pass the Anti-Nuke access check. The current callback does not set a confirmation expiry.

Headless clones the channel, attempts to preserve its position, and then deletes the original. The ID changes and message history is not copied. The case retains the old reference and the log points to the new channel. Automatic clone cleanup is attempted only if something fails before the original is deleted; after deletion, there is no automatic rollback.

If you omit the reason, the command records the default text `Channel recreated`.

> [!WARNING]
>
> The original channel is deleted and its message history is not copied; its ID changes, and there is no automatic rollback after deletion. After recreation, Headless posts the literal `first` message in the replacement channel. Review the channel and permissions before confirming.

### `.nuke`

```headless-command Syntax theme={null}
.nuke [reason]
```

```headless-command Example theme={null}
.nuke reason recorded
```

### `.nuke`

```headless-command Syntax theme={null}
/nuke [reason:<reason>]
```

```headless-command Example theme={null}
/nuke reason:channel damaged
```

> [!WARNING]
>
> Lock and lockdown save different overwrite scopes: `.lock` saves only `@everyone`, while lockdown also saves configured allowed roles. Avoid editing these overwrites while a snapshot is active. If `.endlockdown` reports pending restoration, fix the Discord permission/hierarchy issue and retry it; do not start a second lockdown.

## Steps

**1. Identify the scope**

Test lock and slowmode in a staging channel. Before lockdown, review categories, channels, and configured allowed roles.

**2. Apply the smallest change**

Choose the channel, duration, and reason. Do not lock a category without checking channels that inherit its permissions.

**3. Verify the result**

Confirm effective access in Discord and review the case and log event, including partial failures.

**4. Restore and check**

After a temporary measure, run `.unlock` or `.endlockdown` as appropriate and manually review channels Discord could not restore.

## Related pages

* [Moderation and configuration](/docs/en/security/moderation.md)
* [Logging](/docs/en/server/logging.md)
* [Headless permissions](/docs/en/permissions.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.