Bans many members in one command: the ones named in targets, everyone who joined in the last joined_within minutes or both. Discord shows the /mass commands only to members with Timeout Members by default, because a command group has one default permission for all of its commands. The bot checks Command Access rules, that the Moderation service is enabled ("Sentinel is not enabled for this server.") and that the moderator is an Administrator or holds a moderator role from the Settings page ("No permission."). The moderator must also have Ban Members ("You need the Ban Members permission to run /mass ban."). While anti-nuke is on, only the server owner, a Sentinel extra owner or an anti-nuke exempt account or role can run it ("Anti-nuke is on, so only the server owner, a Sentinel extra owner or an anti-nuke exempt account or role can run /mass ban. Mass actions run as this bot, and anti-nuke does not watch this bot."), because the bot does the work and anti-nuke never acts on the bot. If the server's Sentinel settings cannot be read, nothing runs ("I couldn't read this server's Sentinel settings, so nothing ran. Try again in a moment.").
The targets option takes mentions or user IDs separated by spaces or commas. The joined_within option takes 1 to 1440 minutes. At least one of the two is needed: "Name members in targets or set joined_within. You can use both." The delete_messages option removes the members' recent messages: none, 1 hour, 24 hours (the default) or 7 days. The bot's role needs both Ban Members and Manage Server, because Discord's bulk ban asks for both. When one is missing the reply names it, for example "I can't run /mass ban: my role is missing Manage Server. Give my role that permission, then try again. Discord's bulk ban needs both Ban Members and Manage Server."
The bot leaves out the server owner, itself, the moderator running the command, other moderators (Administrators and holders of a moderator role), bots not named in targets, anyone it could not look up and anyone whose highest role is at or above the moderator's or the bot's own. The server owner is not limited by their own role position. A user who is no longer in the server is still banned, like /ban. Members named in targets come first, then recent joins from newest to oldest. Each command bans at most 200; the rest are skipped as over the limit.
The plan is always shown first, whatever "Confirm before destructive actions" says, and only the moderator sees it. It opens with "Ban 12 members?" and up to 10 names, then the reason ("Reason: none given" without one). Next comes "Their messages from the last 24 hours are deleted." or "Their messages are kept." When some of them are not in the server, it adds "2 of them are not in the server and are banned anyway." A skipped line counts who was left out and why, for example "Skipped 3: the server owner, 2 moderators." Then "Confirm within 30 seconds, or it is cancelled." sits above Confirm and Cancel buttons. Only the moderator who ran the command can answer, and without an answer the prompt reads "Cancelled: no answer within 30 seconds." When no one is left, the reply is "No one to ban." with the skipped line, and nothing runs.
On Confirm the prompt changes to "Working on 12 members..." and the bans go out through Discord's bulk ban. Members get no DM. Each member Discord banned gets a ban case. Its reason starts with "Mass ban:" followed by the reason given, or is just "Mass ban" without one. Discord's audit log shows the same text. The case numbers run in a row. A "Mass ban" card goes to the moderation log channel with who acted, the done, failed and skipped counts, how far back messages were deleted, the case range, the reason and the banned members. The result arrives as a new message, for example "Banned 12 of 12. Cases #40 to #51. 3 skipped." The prompt then reads "Confirmed." Confirm runs every check again first, the anti-nuke rule and a frozen account included, and if one now refuses, the prompt shows that refusal instead and nothing runs.
When Discord bans only some of them, the result adds the failed count and "Discord did not ban some of them. They may already be banned or have a role above mine." No case is opened for anyone who was not banned.
Good to know
- Only one mass action runs in a server at a time; another is refused with "Another mass action is running in this server. Try again when it finishes." After a confirmed run the same moderator waits 30 seconds before the next one ("Wait 12 seconds before running another mass action.").
- The joined_within option reads the server's member list and Sentinel's own join log, so it also finds accounts that joined and left again. They are banned too.
- Mass bans are permanent. /unban lifts one.
- With ban sync or a ban network set up on the Ban evasion page, the bans are passed on to the linked servers after the result.
- With anonymous moderation on, the log card says "the moderation team" instead of naming the moderator.
- If the cases cannot be saved, the result says "The cases could not be saved. The actions above still happened."
- While an anti-nuke panic lockdown is on, only the server owner, Sentinel's extra owners and the anti-nuke exempt users and roles can run it.