Discord bot · Security
Moderation commands
Ban, kick, time out, mute, jail and warn members, clean up channels and manage roles. Every action is logged with who did it and why, and each command also has a slash version under /mod.
Before you start#
Moderation works out of the box. Three things make it better:
- A log channel for moderation actions: bot panel → Logging, or
/server config logs. - The jail (a role and a channel only jailed members can see) and the mute roles:
,setup jailand,setup mute. - Moderators with fake permissions instead of real ones.
Syntax
,setup jail ,setup mute
,setup mute makes three roles and denies them in every channel: Muted (can't write, react, talk or make threads), Image Muted (no files, links with previews or stickers) and Reaction Muted (no reactions or outside emojis). Run it again after adding new channels.
Timeouts, mutes and the jail#
- Timeout (
,timeout) uses Discord's own timeout: up to 28 days, ends by itself. - Mute, image mute, reaction mute use roles, so they can last any time (or until lifted) and only take away part of what someone can do. A timed mute ends by itself; the end time is kept in the bot's database, so it still ends on time after the bot restarts, and someone who leaves and rejoins is muted again. Until you run
,setup mute,,muteworks as a timeout. - Jail takes all of someone's roles and keeps them in the jail channel, where a moderator can talk to them.
,unjailgives every role back.
Invoke messages#
Your own message when someone is punished: posted in the channel where the command was used, sent to them in a DM, or both. It works for ban, kick, softban, tempban, hardban, timeout, mute, imute, rmute, jail and warn. The DM is sent before a ban or kick (afterwards the bot can't reach them). A custom ban DM replaces the default one with the appeal button, so add your appeal link to it.
| {user.mention}, {user.name} | The member who was punished |
| {moderator} | Who did it |
| {reason} | The reason (or "No reason given") |
| {duration} | For timed punishments: 10m, 7d… |
| {guild.name} | Your server |
| {action} | ban, kick, mute… |
Commands#
,banalso ,bBan Members
Ban a member
Syntax
,ban <user> [reason]
Examples
,ban @specter spamming invites ,ban 123456789012345678 ban evasion
,clearwarnsalso ,clearwarningsTimeout Members
Delete a member's warnings
Syntax
,clearwarns <user>
Example
,clearwarns @specter
,hardbanalso ,hbAdministrator
Ban someone for good: unbanning by hand or rejoining bans them again
Syntax
,hardban <user> [reason]
Examples
,hardban @raider ,hardban list
,imutealso ,imagemuteTimeout Members
Give the Image Muted role (optionally for a while)
Syntax
,imute <user> [10m|2h|1d] [reason]
Examples
,imute @specter 1d posting gore ,imagemute @specter
,invokeManage Server
Your own message in the channel or in DMs when someone is banned, kicked, muted, jailed, warned or timed out
Syntax
,invoke <action> <message|dm> <script> ,invoke <action> <message|dm> reset ,invoke list
Examples
,invoke ban dm You were banned from {guild.name}. Reason: {reason}
,invoke kick message {user.name} was kicked by {moderator}.
,invoke mute dm You're muted for {duration}: {reason}
,invoke ban dm reset
,invoke list,jailTimeout Members
Take a member's roles and keep them in the jail channel
Syntax
,jail <user> [reason]
Example
,jail @specter wait for a moderator
,jailedTimeout Members
Who is in jail
Syntax
,jailed
Example
,jailed
,kickalso ,kKick Members
Kick a member
Syntax
,kick <user> [reason]
Example
,kick @specter last warning ignored
,lockManage Channels
Stop @everyone sending messages
Syntax
,lock [#channel]
Examples
,lock ,lock #general
,muteTimeout Members
Give the Muted role (optionally for a while)
Syntax
,mute <user> [10m|2h|1d] [reason]
Examples
,mute @specter 1h ,mute @specter arguing in general
,nukeAdministrator
Recreate this channel empty (same settings)
Syntax
,nuke confirm
Example
,nuke confirm
,purgealso ,c, ,clearManage Messages
Delete messages with filters
Syntax
,purge <1-100> [bots|humans|links|images|@user|contains <text>]
Examples
,purge 50 ,purge 100 bots ,purge 30 @specter ,purge 20 contains free nitro ,purge 40 links
,rmutealso ,reactionmuteTimeout Members
Give the Reaction Muted role (optionally for a while)
Syntax
,rmute <user> [10m|2h|1d] [reason]
Example
,rmute @specter 2h reaction spam
,rolealso ,rManage Roles
Give (+) and take (-) several roles at once; a role without + or - is switched
Syntax
,role <user> <+role> [-role] ...
Examples
,role @specter +Members ,role @specter +Verified -Unverified
,slowmodealso ,slowManage Channels
Set slowmode here
Syntax
,slowmode <seconds|off>
Examples
,slowmode 10 ,slowmode off
,softbanalso ,sbBan Members
Ban and unban straight away: removes them and their messages from the last 7 days
Syntax
,softban <user> [reason]
Examples
,softban @spambot ,sb @spambot scam links
,tempbanalso ,tbBan Members
Ban for a while; they're unbanned automatically (even after a restart)
Syntax
,tempban <user> <30m|12h|7d|2w> [reason]
Examples
,tempban @specter 7d toxic in voice ,tb @specter 12h
,timeoutalso ,toTimeout Members
Time someone out
Syntax
,timeout <user> <10m|2h|1d> [reason]
Examples
,timeout @specter 10m calm down ,to @specter 2h
,unbanBan Members
Unban someone by ID
Syntax
,unban <user> [reason]
Example
,unban 123456789012345678 appeal accepted
,unhardbanalso ,uhbAdministrator
Lift a hardban and unban
Syntax
,unhardban <user>
Example
,unhardban @raider
,unimutealso ,unimagemute, ,iunmuteTimeout Members
Take the Image Muted role away
Syntax
,unimute <user>
Example
,unimute @specter
,unjailTimeout Members
Release a member and give their roles back
Syntax
,unjail <user>
Example
,unjail @specter
,unlockManage Channels
Let @everyone send messages again
Syntax
,unlock [#channel]
Example
,unlock #general
,unmuteTimeout Members
Take the Muted role away
Syntax
,unmute <user>
Example
,unmute @specter
,unrmutealso ,unreactionmute, ,runmuteTimeout Members
Take the Reaction Muted role away
Syntax
,unrmute <user>
Example
,unrmute @specter
,untimeoutalso ,utoTimeout Members
Remove a timeout
Syntax
,untimeout <user> [reason]
Example
,untimeout @specter
,warnTimeout Members
Warn a member (warning escalation from the AutoMod page applies)
Syntax
,warn <user> <reason>
Example
,warn @specter no NSFW in general
,warningsalso ,warnsTimeout Members
A member's warnings
Syntax
,warnings <user>
Example
,warnings @specter
Slash versions
Most of these are also under/mod (/mod ban, /mod timeout, /mod purge…) with fields to fill in. The full list is on Commands.