Bans a user and opens a case. Discord shows the command only to members with Ban Members by default. 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 member option also accepts someone who has already left, or a pasted user ID, so a user can be banned before they ever join. The server owner and bots can never be banned, and a member who is still in the server must rank below the moderator ("Cannot action that member.").
Leave the duration empty for a permanent ban. A duration such as 1h, 1d or 7d makes a temporary ban; a value that does not parse is refused with "Invalid ban duration. Use something like 1h, 1d, 7d, or leave it empty for a permanent ban." The delete_days option removes that many days of the user's messages, 0 to 7, and defaults to 1.
With "Confirm before destructive actions" on, the bot first asks "Ban @member (permanent)? Reason: ..." with Confirm and Cancel buttons. Only the moderator who ran the command can answer, and the prompt expires after 30 seconds.
When the member is still in the server and "DM on ban" is on, the ban DM goes out first (stock text "You have been banned from {server}: {reason}", followed by a web appeal link when the dashboard has a public address), because a ban cuts the bot's contact with them. Then the ban is applied. If Discord refuses it, the moderator is told and no case is opened. On success the bot opens a ban case, posts a "Ban" card with the duration or "Permanent" to the moderation log channel, and replies with the user followed by "banned (permanent). Case #12". For a user who was not in the server the reply adds "They were not in the server, so the ban is recorded now and applies if they try to join."
Good to know
- A temporary ban is lifted automatically when it runs out. /unban lifts it early and cancels the timer.
- With ban sync or a ban network set up on the Settings page, the ban is passed on to the linked servers.
- With anonymous moderation on, the DM and the log card say "the moderation team" instead of naming the moderator.
- While an anti-nuke panic lockdown is on, only the server owner and the anti-nuke exempt users and roles can run it.