Channels & Messages
Lock channels and delete messages, in one channel or everywhere.
/lock
Stop a role from sending messages in a channel.
Who can use it: Manage Channels, or staff allowed to Lock Channels
Denies Send Messages and Send Messages in Threads for the role in the channel, and remembers the old permissions so /unlock can restore them. A thread is locked instead, and an optional message is posted as a 'Channel locked' embed.
| Option | Type | Required | |
|---|---|---|---|
channel | Channel | Channel to lock. Defaults to this one. Default: The current channel. | |
role | Role | Role to lock it for. Defaults to @everyone. Default: @everyone. | |
message | Text | A message to post in the channel. | |
viewchannel | Choice | Also clear an allowed View Channel. Defaults to yes. One of: Yes, No. Default: yes. | |
visible | Choice | Show the reply to everyone. Defaults to yes. One of: Yes, No. Default: yes. |
Good to know
- With viewchannel on (the default), an explicit View Channel allow for that role is reset to neutral.
- You can only lock for roles below your highest role.
/unlock
Let a role send messages in a channel again.
Who can use it: Manage Channels, or staff allowed to Lock Channels
Puts back the role's send permissions from before the lock (and View Channel, unless viewchannel is No). If Guard has no record of the lock, it only clears a deny that looks like Guard's own. A thread is unlocked instead.
| Option | Type | Required | |
|---|---|---|---|
channel | Channel | Channel to unlock. Defaults to this one. Default: The current channel. | |
role | Role | Role to unlock it for. Defaults to @everyone. Default: @everyone. | |
viewchannel | Choice | Also give back View Channel if the lock took it. Defaults to yes. One of: Yes, No. Default: yes. | |
visible | Choice | Show the reply to everyone. Defaults to yes. One of: Yes, No. Default: yes. |
/lockall
Lock every channel picked in the channel locking settings.
Who can use it: Manage Channels, or staff allowed to Lock Channels · Cooldown: 10s
Locks every channel picked in /settings > Moderation > Channel Locking (a picked category includes its channels). Depending on the lock mode, it locks the picked roles, or locks @everyone while the picked roles can still talk. It then reports how many channels and roles it locked and posts the optional message in each channel it changed.
| Option | Type | Required | |
|---|---|---|---|
reason | Text | Reason for the lockdown. | |
message | Text | A message to post in every locked channel. | |
visible | Choice | Show the reply to everyone. Defaults to yes. One of: Yes, No. Default: yes. |
Good to know
- Fails if no channels or roles are set up for locking.
- The reason goes into Discord's audit log.
/unlockall
Unlock every channel picked in the channel locking settings.
Who can use it: Manage Channels, or staff allowed to Lock Channels · Cooldown: 10s
Undoes the lockdown on every channel picked in the channel locking settings, putting back the permissions saved when they were locked. It posts the optional message in each channel it changed.
| Option | Type | Required | |
|---|---|---|---|
reason | Text | Reason for lifting the lockdown. | |
message | Text | A message to post in every unlocked channel. | |
visible | Choice | Show the reply to everyone. Defaults to yes. One of: Yes, No. Default: yes. |
Good to know
- Only reverts locks Guard saved. Channels without a saved lock are left alone.
/purge
Delete recent messages in this channel.
Who can use it: Manage Messages, or staff allowed to Delete Messages · Cooldown: 3s
Looks through the channel's latest 100 messages (or the 100 before start), then deletes up to amount of the ones that match your filters. It then posts how many it deleted and logs the purge.
| Option | Type | Required | |
|---|---|---|---|
amount | Number | How many to delete. Defaults to 10. From 1 to 100. Default: 10. | |
member | User | Only delete messages from this member. | |
content | Text | Only delete messages with this text. | |
pinned | Choice | Also delete pinned messages. Defaults to no. One of: Yes, No. Default: no. | |
bots | Choice | Only delete messages from bots. Defaults to no. One of: Yes, No. Default: no. | |
start | Text | ID or link of the newest message to delete. Defaults to the latest. | |
end | Text | ID or link of the oldest message to delete. |
Good to know
- The content filter is a case-insensitive contains match.
- Messages older than 14 days can't be bulk deleted, so Guard deletes up to 25 of them one by one.
- Guard needs Manage Messages and Read Message History in the channel.
/purgeall
Delete a member's messages or a link or text across every channel.
Who can use it: Manage Messages, or staff allowed to Purge Everywhere · Cooldown: 10s
Uses Discord's message search to find matching messages in every channel within the time window, then deletes them and logs the purge. Only you see the reply, which says how many it deleted, in how many channels, and how many it skipped.
| Option | Type | Required | |
|---|---|---|---|
member | User | Delete this member's messages. | |
link | Text | Delete messages linking to this site, like scam.example. | |
content | Text | Delete messages containing these words. | |
within | Choice | How far back. Defaults to 24 hours. One of: Last hour, Last 6 hours, Last 24 hours, Last 3 days, Last 7 days, Last 14 days. Default: 24h. | |
amount | Number | Most messages to delete. Defaults to 250. From 1 to 1000. Default: 250. | |
pinned | Choice | Also delete pinned messages. Defaults to no. One of: Yes, No. Default: no. |
Good to know
- Needs at least one of member, link or content. The link filter matches by hostname, and a www. address also matches the bare domain.
- Content matching uses Discord search, which matches whole words.
- Without a member filter, only messages from users are searched, not bots.
- Skips archived threads, channels you can't see, and channels where Guard can't delete messages. Only one server-wide purge can run at a time.
- Fails if Discord is still indexing the server's messages.