Protection
Anti-nuke: what it watches, how tries and punishments work, restoring a member, and command limits.
Protection watches for destructive actions and stops the account doing them. It is aimed at a compromised staff account or a malicious bot, not at ordinary moderation. Every /protection command needs Administrator.
Turning it on
- 01Enable the module
/protection enableswitches protection on for the server. Until then, nothing is watched. - 02Set a log channel
/protection setlog channel:#channel. Every counted action posts a warning there, and every punishment posts a record with its restore button. Run it without a channel to stop the logs. - 03Whitelist the people you trust
/protection whitelist action:Add user:@member. Whitelisted members are not counted. Keep the list short. - 04Arm each action
/protection setupwith an action, tries, time and punishment. Enabling the module arms nothing on its own: every action starts off.
/protection notifications enabled:True also sends the server owner a direct message each time someone is punished.
What it watches
Protection works from Discord's audit log: each new entry tells Epix what happened and who did it. That is why Epix needs View Audit Log. Without it, Epix cannot see who did anything.
| Action | What counts |
|---|---|
| Bans | A member banned. |
| Kicks | A member kicked. |
| Channel Delete | A channel deleted. |
| Channel Create | A channel created. |
| Channel Update | Any edit to a channel. |
| Role Delete | A role deleted. |
| Role Create | A role created, whatever its permissions. |
| Role Update | Any edit to a role. |
| Role Permission Grant | A member given a role that holds Administrator, Ban Members, Kick Members, Manage Server, Manage Roles, Manage Channels, Manage Messages, Manage Nicknames or Manage Webhooks. |
| Prune (Premium) | Someone prunes members. Covered in its own section below. |
Bot Add, Server Update and Vanity URL Change also appear in the menu, but none of them currently reacts to a bot being added, server settings changing or the vanity URL changing. Do not rely on them.
Epix ignores its own actions. A ban made with Epix's /ban shows Epix in the audit log, so anti-nuke never counts it. To cap how often staff use Epix's moderation commands, use command limits, below.
Tries, time and punishment
/protection setup takes three values for an action: tries, from 1 to 20, the number of counted actions that triggers the punishment; time, a window written as 30s, 10m, 1h or 1d; and the punishment. When the tries are reached, the punishment is applied and that member's count for the action starts again from zero.
Set tries above what your staff do on a normal day and below what an attack looks like. Those two numbers are further apart than people expect: a moderator deleting three spam channels is normal, and thirty is not. Channel Update and Role Update count every edit, so they need more headroom than deletions.
/protection disable turns one action off. /protection view lists every action with its tries, window and punishment, plus the whitelist and role overrides.
Punishments
| Level | Effect | Restore |
|---|---|---|
| 1 – Remove All Roles | Removes every role the member holds. | Gives the roles back. |
| 2 – Kick | Removes the member from the server. | Not possible. They can rejoin with an invite. |
| 3 – Ban | Bans the member. | Unbans them. Their roles are not given back. |
| 4 – Remove Admin Roles | Removes only the member's roles that hold Administrator, Ban Members, Kick Members, Manage Server, Manage Channels or Manage Roles. | Gives those roles back. |
| 5 – Remove Dangerous Permissions | Currently does the same as level 4. | Gives those roles back. |
Whitelist and role overrides
The whitelist holds members, not roles. A whitelisted member's actions are not counted. Prune is the exception: it ignores this whitelist.
A role override gives members of one role their own tries, window and punishment for an action: /protection roles action:Setup role:@role protection_action:Bans, then any of tries, time and punishment. An override arms that action for the role even if the action is off for everyone else. If a member holds several roles with an override for the same action, the one added first is used.
Logs, notifications and restoring
With a log channel set, each counted action posts a warning showing the member, the action and their count against the tries. A punishment posts the punishment applied, a Punishment ID and the roles removed. When roles were removed, the message has a Restore Roles button.
- Pressing Restore Roles needs Manage Roles. Each Punishment ID can be restored once.
- Roles are given back only if the member is still in the server and the role still exists below Epix's highest role.
- A successful restore posts a User Restored message to the log channel.
- Owner notifications are sent for punishments only, not for warnings.
Prune (Premium)
Prune protection acts on the first prune, with no tries and no window: the member who pruned is punished immediately. Only Remove All Roles or Kick is allowed, and the default is Kick. The main whitelist does not apply, and prune punishments are not posted to the protection log channel.
Command limits
Command limits cap how often a member can use Epix's moderation commands: ban, kick, timeout, untimeout, mute, unmute, vmute, unvmute, deafen, undeafen, role, rolemulti, unban and unjail. They work even if protection is not enabled.
/protection setlimitwith a command, time and limit sets uses per window. The window is 1 hour to 1 day (1h, 6h, 12h, 1d) and the limit is 1 to 1,000.- Add role:@role to give that role its own limit. A member gets the highest limit that applies to them, so role limits are for raising the cap. If the command has no limit yet, the role's number also becomes the limit for everyone.
- Each command has one window. Setting any limit on it changes the window for the whole command.
- The window starts at the first counted use. A member over the limit gets a reply only they can see, with their usage and when it resets.
/protection removelimitremoves a command's limit, or only one role's limit with role:@role./protection viewlimitslists them all.
A server-wide cap, one total shared by everyone, can be set through Epix AI.
Commands
| Command | What it does |
|---|---|
/protection enable | Switches protection on for the server. |
/protection setup | Arms an action with tries, time and punishment. |
/protection disable | Turns one action off. |
/protection view | Shows every action, the whitelist and role overrides. |
/protection whitelist | Adds or removes a member. |
/protection roles | Sets up or removes a role override. |
/protection setlog | Sets or clears the log channel. |
/protection notifications | Turns owner direct messages on or off. |
/protection setlimit | Sets a command limit. |
/protection removelimit | Removes a command limit. |
/protection viewlimits | Lists command limits. |