/ban
Ban a user from the server. Creates a moderation case, optionally notifies the user via DM, and logs the action to the mod log channel.
Required Permission
Both the user executing the command and the bot must have the Ban Members permission.
Options
| Option | Required | Description |
|---|---|---|
user | Yes | The user to ban. Select from the user picker or type a username. |
reason | No | Reason for the ban. Supports autocomplete with preset reasons filtered to the BAN action type. |
delete_days | No | Number of days of message history to delete from the banned user. Accepts 0 through 7. When omitted, the server's Ban message deletion setting (Dashboard → Moderation → Action preferences) decides; passing a value overrides it for this ban only. |
evidence | No | A screenshot or file attachment to store with the case as evidence. |
silent | No | If set to true, the bot will not send a DM to the banned user. Defaults to false. |
overrule | No | If the user is already banned, replace that ban with this one (see Banning someone who is already banned). Defaults to false. |
Behavior
- DM notification -- Unless
silentis enabled, the bot sends a direct message to the target user. The DM includes the server name, the reason for the ban, and a clickable Appeal button if the appeals system is enabled for the server. The content and appearance of this DM are controlled by the DM_BAN message template and can be customized per guild. - Discord ban -- The bot executes the ban through the Discord API, deleting the message history the server's Ban message deletion setting asks for, or the
delete_daysvalue when one was given. - Case creation -- A case record is created with the action type BAN, including the target user, moderator, reason, evidence, and timestamp.
- Mod log -- If a mod log channel is configured, the bot posts a formatted embed with the full ban details.
Banning someone who is already banned
Running /ban on a user who is already banned does not silently ban them again. The bot shows you the ban already in force first - the case number, who issued it, when, and the reason - with buttons to open the case in the dashboard and jump to its mod-log message. If the ban was issued directly in Discord and has no Thrella case, the bot shows Discord's own ban reason instead.
This matters because Discord accepts a ban on an already-banned user but does not overwrite the stored ban reason. A plain re-ban would look like it worked while changing nothing.
To actually replace the ban - for example to correct or expand the reason - run the command again with overrule: True. The bot then:
- Rewrites the ban on Discord so the new reason really does replace the old one. The user stays banned throughout; if the new ban cannot be applied, the previous ban is restored automatically.
- Creates one new case with the new reason.
- Marks the previous ban's case as superseded and links the new case to it. No unban case is created - nobody was unbanned, the ban was rewritten.
The same flow is available in the dashboard: opening a case for a currently-banned user shows a banner naming the active ban, and the Ban quick action asks you to confirm the overrule before it proceeds.
Notes
- The DM is sent before the ban is executed, because Discord cannot deliver DMs to users who are not in a mutual server. If the DM fails (e.g., the user has DMs disabled), the ban still proceeds.
- If the target user is not bannable (e.g., they have a higher role than the bot), the command will fail with an appropriate error message.
- Use the
silentoption when you do not want to alert the user, such as when banning spam accounts. - The bot's response to this command is ephemeral - only visible to the moderator who ran it.
- If public filter notifications are enabled for manual mod actions, a brief notice is posted in the channel and auto-deleted after the configured duration.