Moderation Server only

/ban

Ban a member from the server

Usage

Generated
/ban <member> <reason> [duration] [delete_days]
OptionTypeRequiredDescription
member member Yes Member to ban
reason text Yes Reason
duration text No Optional temp ban: 1h, 1d, 7d (leave empty for permanent)
delete_days whole number No Days of message history to delete (0-7)

Who can run it

Generated
Discord defaultMembers with Ban Members
Command Access presetModerator roles
Always allowedThe server owner and, by default, Administrators
Change itDashboard, Services, Sentinel, Commands

The Moderation preset limits it to the roles you mark as moderators. Server owners and Administrators can always run it. How Command Access works.

What the bot needs

Generated

Sentinel is granted these permissions by the invite link. A command that finds one missing replies privately with what it could not do and changes nothing.

Kick MembersBan MembersManage ServerView ChannelSend MessagesManage MessagesEmbed LinksManage NicknamesManage RolesTimeout Members

Behaviour

Checked against the code 2026-09-21

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.
YourBot docs Reference tables are generated from the code that is running. Ask in Discord Suggest a correction