Skip to main content
Antinuke protects your server from the things people do to destroy one: mass deletions, permission grabs, unauthorised bots, and webhook spam. Here’s how it works. mira watches the events you turn on, counts how many actions each member takes against a threshold you set, applies your chosen punishment to anyone who goes over it, and DMs you a summary with buttons to undo the damage.
Nothing is enabled by default. Antinuke does nothing at all until you turn an event on.

Setup

Follow these in order. You set the punishment and your exemptions first, so no event is live while it’s still half configured.
1

Give mira Administrator, at the top of the role list

Discord won’t let a bot take action against anyone whose highest role sits above its own. If mira is somewhere in the middle of your role list, anyone above it can tear the server apart without being stopped.
This part isn’t optional. If mira’s role is below an attacker’s, the action is still detected, but the punishment won’t go through.
2

Open your DMs in a server you share with mira

Alerts come by DM, and so do the buttons you press to restore anything that gets deleted. Closed DMs don’t stop protection from working, but you won’t hear about anything and you won’t be able to undo it.
Discord’s DM setting works per server, so you don’t have to open your DMs anywhere public. Turn it on in any small private server that mira is also in and the alerts still reach you.
3

Decide what happens to offenders

Skip this and the first false positive is a ban, since that’s the default. Stripstaff and jail both keep the person in the server with nothing they can abuse, which is safer while you’re still working out the right limits.
4

Exempt the people and bots that do this for a living

Add anything that regularly creates channels, edits roles, or posts through webhooks. Whitelisting only stops someone being detected, it doesn’t give them any permissions.Mods who ban and kick using mira count toward the same limits as everyone else, so add your busiest staff here too.
5

Turn on the events you want

Each one starts at 3 actions per 1h. Events has the full list and Thresholds covers changing those numbers.
6

Check your work

Events

You turn on each event separately, and every one takes a <status>. The accepted values are on the Arguments page.
Syntax
It doesn’t matter how someone does something. Discord’s own menus, another bot, and mira’s commands all count the same, so ban, kick, and role are treated exactly like doing it through Discord. You can’t get around antinuke by using mira.
You need a <status> on every change, even when you’re only adjusting a threshold. antinuke channel --threshold 2 doesn’t have one, and a missing status counts as off, so the event you were trying to tighten turns off instead.
Correct
The six create and delete events all work the same way. These three are different:
Syntax
Any bot that joins gets kicked, and whoever added it gets punished. There’s no count to build up, one bot is enough.To let a bot in, you whitelist the bot. Whitelisting the person adding it does nothing.
Clear a bot before inviting it
This is on purpose. Adding a malicious bot is the quickest way to destroy a server, and it almost always happens through a hacked staff account that’s already whitelisted.
Syntax
This catches anyone giving themselves more power, or handing it to someone else:
  • Giving themselves a role with a dangerous permission
  • Adding dangerous permissions to a role that already exists
  • Giving that role to someone else, including through role <member> <role>
There’s nothing to count here. The first time it happens, it triggers.It’s also the only event that fixes itself. The role’s permissions go back to exactly what they were within milliseconds, before anyone gets a chance to use them.
Syntax
When a webhook message goes over either limit, three things happen:
  1. Up to 200 of that webhook’s recent messages in the channel are deleted, not just the one that went over.
  2. Every webhook in the server is deleted.
  3. Whoever created the offending webhook is punished.
Deleting all of them is intentional. One webhook link can be pointed at any channel, so mira treats the whole set as compromised. Real webhooks from GitHub, status pages, and automation tools go with them and you’ll need to set those up again.
Nothing is counted over time here. mira checks each message on its own and triggers on the exact number you set, so --mentions 5 goes off at 5 mentions.If the person who created the webhook has already left the server, they’re banned no matter what your punishment is set to. There’s nobody left to strip or jail.

Thresholds

Every event except bot, permissions, and webhookspam counts each member’s actions. Durations lists the time formats you can use. It works like a counter with a timer attached:
  • Each matching action adds 1 to the counter.
  • Each action also resets the timer to its full length, not to whatever was left of it.
  • The counter only clears once the timer runs all the way out with no activity, and it clears to zero all at once. Actions don’t expire one by one.
The punishment lands on the action after the number you set. A threshold of 3 lets someone do three things, and the fourth one triggers it.
Here’s --threshold 3 --duration 60s in action: That fourth deletion came two minutes after the first. With a fixed timer the earlier ones would have been forgotten by then, but each deletion pushed the timer back and kept the count going. If nothing had happened until 160s, the timer would have run out at 150s, the count would have cleared, and that deletion would have started again at 1.
This is why going slowly doesn’t help. Deleting a channel every 50 seconds keeps the count alive indefinitely, so a 60s timer still catches you even though you never did three things inside one minute.

Punishments

One punishment covers every event, webhook spam included. You can’t set a different one per event.
Syntax
<> marks a required argument, [] marks an optional one. Don’t type the brackets themselves. See Arguments for quoting, flags, and everything else.
kick is the weakest of the four. Anyone kicked can come straight back with a new invite, and an autorole will hand their permissions back.
Every role the offender has that includes a dangerous permission, plus any role you’ve given custom bot command permissions.Some roles can’t be removed at all. Discord won’t let a bot take an integration or bot role off its owner, so in that case mira strips the dangerous permissions from the role itself instead.If there’s nothing that can be taken off them, stripstaff bans them instead, or kicks them if mira can’t ban.
Stripstaff can’t touch any role sitting above mira’s own.
Jail does the strip above, then moves the person into a jail channel where they’re cut off from everyone.It sets itself up the first time you use it, so there’s nothing to configure beforehand. Let someone out with unjail <member>, which gives back the roles they lost.

Dangerous permissions

These are the permissions the permissions event watches for and stripstaff removes:
  • Administrator
  • Ban Members
  • Kick Members
  • Manage Server
  • Manage Roles
  • Manage Channels
  • Manage Webhooks
  • Manage Expressions
  • Manage Nicknames
  • Mention Everyone

Whitelist and trust

These two get mixed up a lot, but they do completely different things. Whitelisting stops someone from being detected. Trust gives someone control over antinuke. Both commands toggle. Run one to add someone, run it again to take them back off.
Syntax
Managing the lists
Trust gives someone complete control of your protection, including turning it off. Only the owner can grant it. Keep it for people you’d trust with the server itself.
clear empties a whole list in one command. Clear your trust list and you’ll be the only person left who can change anything.

Alerts and recovery

Alerts go to the server owner by DM and nowhere else. Trusted members don’t get anything, so they can only help if you show them the message.

Undone automatically

Dangerous permission grants. The role goes back to exactly the permissions it had within milliseconds, before anyone can use them. You don’t have to do anything.

Undone with a button

Roles and channels that get deleted or created are not restored on their own. mira saves a copy and DMs you buttons to undo one thing, or everything at once.
Discord doesn’t remember who had a role once it’s been deleted, so mira keeps its own record. That’s why restored roles come back with the members still in them.
Nothing comes back until someone presses a button. Only the owner or a trusted member can press them, and if your DMs are closed the message never arrives at all.
A few staff, low risk, mistakes more likely than attacks. The defaults suit this well.
With stripstaff, a mod having a bad day loses their roles instead of their place in the server.

Troubleshooting

Most likely reasons first: the event was never turned on, the member is whitelisted, mira’s role is below theirs, or they own the server. antinuke settings shows what’s on and antinuke whitelist list shows who’s exempt.
They went over a threshold. Either whitelist them, or raise the threshold and shorten the duration on that event so normal bursts clear before they add up.
That’s expected. ban, kick, and role all count toward thresholds however you run them. Whitelist the staff who use them regularly, or raise the threshold on that event.
Every change needs a <status> with it. antinuke channel --threshold 2 doesn’t have one, so it reads as off. Include one every time: antinuke channel on --threshold 2.
Webhook spam protection triggered. Clearing all of them is intentional, since one webhook link can be used in any channel. Set your integrations up again, then raise --mentions if the message that triggered it was legitimate.
The bot event removes anything that isn’t whitelisted, no matter who invited it. Whitelist the bot first, then invite it again.
Your DMs are closed in every server you share with mira. Open them in any one of those, a small private server included. Until then the alert and its buttons have nowhere to go.

Limits

  • The server owner can’t be punished. Discord won’t let a bot ban, kick, or remove roles from the owner, so a hacked owner account is out of reach.
  • Role position decides everything. Nothing above mira’s role can be stripped or punished.
  • Only the owner is told. Trusted members get no alerts and can only act on buttons the owner passes to them.
  • Restores wait for a button. Apart from permission grants, nothing comes back on its own, so an absent owner leaves a wrecked server wrecked.
  • One punishment for everything. You can’t ban for channel deletions and only strip roles for emoji deletions.
  • There’s no reset command. Events go off one at a time with antinuke <event> off.
  • antinuke settings shows numbers, not names. Use antinuke whitelist list and antinuke trust list for that.
  • Counts are per member. Two attackers working together each build up their own count.

Command reference

Last modified on August 4, 2026