Detects and punishes destructive actions in your server, from mass deletions to webhook spam.
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.
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
antinuke punishment stripstaff
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
antinuke channel onantinuke role onantinuke ban onantinuke kick onantinuke bot onantinuke permissions on
Each one starts at 3 actions per 1h. Events has the full list and
Thresholds covers changing those numbers.
You turn on each event separately, and every one takes a <status>. The
accepted values are on the Arguments page.
Syntax
antinuke <event> <status> [flags]
Event
Triggers on
Flags
ban
Members being banned
--threshold, --duration
kick
Members being kicked
--threshold, --duration
channel
Channels created or deleted
--threshold, --duration
role
Roles created or deleted
--threshold, --duration
emoji
Emojis created or deleted
--threshold, --duration
webhook
Webhooks created or deleted
--threshold, --duration
bot
A bot being added
None
permissions
Dangerous permissions being granted
None
webhookspam
Mass mentions through a webhook
--mentions, --everyone
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
antinuke channel on --threshold 2 --duration 30m
The six create and delete events all work the same way. These three are different:
bot: instant, and the member's whitelist won't save them
Syntax
antinuke bot <status>
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
antinuke whitelist @Carl-bot
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.
permissions: one grant is enough, and it undoes itself
Syntax
antinuke permissions <status>
This catches anyone giving themselves more power, or handing it to someone else:
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.
webhookspam: checked per message, and it clears every webhook
Syntax
antinuke webhookspam <status> [flags]
Flag
Description
Range
--mentions
User mentions in one message before it counts as spam.
5 to 100
--everyone
@everyone or @here mentions in one message before it counts as spam.
0 to 5
When a webhook message goes over either limit, three things happen:
Up to 200 of that webhook’s recent messages in the channel are deleted, not just the
one that went over.
Every webhook in the server is deleted.
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.
Every event except bot, permissions, and webhookspam counts each member’s actions.
Flag
Description
Range
Default
--threshold
Actions allowed before the punishment fires.
1 to 12
3
--duration
How long the count survives without new activity.
10s to 12h
1h
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:
Time
Action
Count
Timer now runs out at
0s
Channel deleted
1
60s
40s
Channel deleted
2
100s
90s
Channel deleted
3
150s
120s
Channel deleted
Punishment fires
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.
<> marks a required argument, [] marks an optional one. Don’t type the
brackets themselves. See Arguments for quoting, flags,
and everything else.
Punishment
What happens
ban
Banned from the server. Default.
kick
Removed, and able to come back with any invite.
stripstaff
Every role with a dangerous permission is taken off them.
jail
The same strip, then moved into a jail channel with nobody to talk to.
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.
What stripstaff takes off
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.
How jail works
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.
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.
Property
Whitelist
Trust
What it does
Exempts from detection
Grants full control of antinuke
Who can grant it
Owner or trusted member
Server owner only
Covers the bot event
No
Not applicable
Receives alerts
No
No
Both commands toggle. Run one to add someone, run it again to take them back off.
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.
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.
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.
What happened
What undoing it does
Role deleted
Recreates it with the same name, colour, permissions, and position, and puts the members back in it.
Channel deleted
Recreates it along with its permission overrides.
Role created
Deletes it.
Channel created
Deletes it.
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.
ntinuke punishment stripstaffantinuke channel onantinuke role onantinuke ban onantinuke kick onantinuke bot onantinuke permissions on
With stripstaff, a mod having a bad day loses their roles instead of their place in the
server.
Active staff, a real chance of being targeted, and integrations posting through webhooks.
antinuke punishment jailantinuke channel on --threshold 2 --duration 30mantinuke role on --threshold 2 --duration 30mantinuke ban on --threshold 4 --duration 10mantinuke kick on --threshold 5 --duration 10mantinuke webhook on --threshold 3 --duration 30mantinuke webhookspam on --mentions 15 --everyone 1antinuke emoji onantinuke bot onantinuke permissions on
Ban and kick get higher limits on short timers, because moderation really does come in
bursts. Channels and roles get tight limits, because nothing normal deletes several of them
in half an hour. Jail keeps the person in the server so you can look at what happened before
you decide.
Everything as sensitive as it goes, false positives accepted.
antinuke punishment banantinuke trust clearantinuke whitelist clearantinuke channel on --threshold 1antinuke role on --threshold 1antinuke ban on --threshold 1antinuke kick on --threshold 1antinuke webhook on --threshold 1antinuke bot onantinuke permissions on
Clearing both lists removes every exemption and everyone who can change your settings except
you. Add them back once things have calmed down.
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.
A moderator got punished for doing their job
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.
antinuke ban on --threshold 6 --duration 5m
I got punished using mira's own commands
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.
I lowered a threshold and the event switched off
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.
Every webhook in the server disappeared
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.
A bot I invited was kicked immediately
The bot event removes anything that isn’t whitelisted, no matter who invited it. Whitelist
the bot first, then invite it again.
antinuke whitelist @Carl-bot
Something was destroyed and I got no DM
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.