# Antinuke

Source: https://righteousbot.dev/docs/protection/antinuke/

Pick the protection that fits your worry, then arm anti-nuke rules against channel deletes, admin grants and vanity theft.

Anti-nuke punishes staff who delete channels, hand out Administrator or wipe emotes faster than a rule
allows. It is aimed at a compromised staff account, not at strangers at the door. Every anti-nuke
command is **Server Owner** only: a granted Administrator permission does not reach it.

## Which protection covers your worry [#which-protection-covers-your-worry]

| Worry                                                                                        | System                                                 | Configured by       |
| -------------------------------------------------------------------------------------------- | ------------------------------------------------------ | ------------------- |
| A staff account deleting channels, roles or emotes, granting admin, or taking the vanity URL | Anti-nuke (this page)                                  | **Server Owner**    |
| A burst of joins, brand-new accounts, default avatars                                        | [Anti-raid](/docs/protection/antiraid/)                | **Administrator**   |
| One person posting too fast or repeating themselves                                          | [Flood protection](/docs/protection/flood-protection/) | **Server Owner**    |
| Bad words, links, invites, music files, mass mentions                                        | [Message filters](/docs/protection/message-filters/)   | **Manage Messages** |
| Spam bots that walk into a channel nobody should post in                                     | [Trap channel](/docs/protection/trap-channel/)         | **Manage Server**   |
| Members handed permissions through the bot                                                   | [Fake permissions](/docs/protection/fake-permissions/) | **Server Owner**    |

Before you arm anything, give the bot **View Audit Log**, a role above the people it may need to
punish (a tie counts as outranked), and the permission each punishment needs. `stripstaff` also needs
roles on your [`,staff`](/commands/server-tools/staff/#staff) list. Try every new rule as `warn` first:
it posts the incident and does nothing to the member.

## Prove it will actually fire [#prove-it-will-actually-fire]

[`,antinuke check`](/commands/server-tools/antinuke/#antinuke-check) reads your live configuration and
reports every reason a rule would do nothing: nothing armed, no **View Audit Log**, roles at or above
the bot, a missing permission, a missing protection log or an empty whitelist. It changes nothing, so
run it after every change.

<CommandBlock syntax=",antinuke check" />

<DiscordEmbed caption="What the check posts on a server with three rules armed and two warnings." invokedWith="/antinuke check" color="#f5a623" author="Righteous's Anti-Nuke Check" description="&#x22;⚠️ 2 roles sit at or above mine in the hierarchy \u2014 anyone holding one of those can't be punished.\n⚠️ The protection log is only reaching #logs through the Logs-channel fallback \u2014 set a dedicated one with `,antinuke log #channel` if that's not intended.&#x22;" fields="[{ name: &#x22;Result&#x22;, value: &#x22;Clean, with 2 things worth a look.&#x22; }]" footer="3 rules armed · 0 fail, 2 warn" />

Fix every failure. A warning can be deliberate: an empty whitelist is fine on some servers.

## Arm a rule [#arm-a-rule]

Set a place to report, whitelist your staff, arm as `warn`, run the check, then promote it.

<CommandBlock syntax=",antinuke log <channel|off>" example=",antinuke log #protection-logs" />

<CommandBlock syntax=",antinuke channel on [++punish <p>] [++threshold <n>] [++window <s>]" example=",antinuke channel on ++punish warn" />

Re-arming keeps the threshold and window you set, so `,antinuke channel on ++punish ban` promotes it.
Without a [protection log](/commands/server-tools/antinuke/#antinuke-log), incidents fall back to
[`,config logchannel`](/commands/server-tools/config/#config-logchannel), and without that they are
lost. The owner is also DMed, but only **once per server per 5 minutes**; vanity theft always sends.

`channel` is one of many rules. The rest, their thresholds, punishments and extra options like revert
are in [Antinuke rule options](/docs/protection/antinuke-rules/).

## Whitelist your staff [#whitelist-your-staff]

[`,antinuke whitelist`](/commands/server-tools/antinuke/#antinuke-whitelist) exempts a user or role
from every rule. An empty whitelist exempts nobody, including your own staff.

<CommandBlock syntax=",antinuke whitelist <add|remove|list|clear> [user|role]" example=",antinuke whitelist add @Staff" />

The server owner is never punishable. Whitelisting a role above your own highest role is refused.

## Review and reset [#review-and-reset]

[`,antinuke info`](/commands/server-tools/antinuke/#antinuke-info) lists every armed rule. The
Anti-Nuke page of the [`,config`](/commands/server-tools/config/) panel edits the same rules.
[`,antinuke reset`](/commands/server-tools/antinuke/#antinuke-reset) turns every rule off but keeps the
whitelist and log channel.

## Common issues [#common-issues]

**The check says a role sits at or above the bot, or a rule is armed but nothing happens.** Drag the bot's
role higher in **Server Settings → Roles** (a tie is as unpunishable as being outranked) and make sure it
has View Audit Log.

**`stripstaff` trips but removes nothing.** Your staff list is empty: [`,staff add <role>`](/commands/server-tools/staff/#staff-add).

**A moderator got punished for doing their job.** Whitelist them or their role, raise the threshold or
widen the window, and re-arm as `warn` while you watch.

**Nothing appears in the log.** Set a dedicated channel with `,antinuke log` and confirm the bot can post
there. Filter actions and trap catches use the general log channel, not the protection log. A second trip
by the same person within 10 minutes is silent on purpose; see
[one punishment per person](/docs/protection/antinuke-rules/#set-the-threshold-window-and-punishment).

More in [Protection never fires](/docs/common-issues/#protection-never-fires).
