Skip to content
Skip to Content
Commands

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.

OptionTypeRequired
channelChannelChannel to lock. Defaults to this one. Default: The current channel.
roleRoleRole to lock it for. Defaults to @everyone. Default: @everyone.
messageTextA message to post in the channel.
viewchannelChoiceAlso clear an allowed View Channel. Defaults to yes. One of: Yes, No. Default: yes.
visibleChoiceShow 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.

OptionTypeRequired
channelChannelChannel to unlock. Defaults to this one. Default: The current channel.
roleRoleRole to unlock it for. Defaults to @everyone. Default: @everyone.
viewchannelChoiceAlso give back View Channel if the lock took it. Defaults to yes. One of: Yes, No. Default: yes.
visibleChoiceShow 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.

OptionTypeRequired
reasonTextReason for the lockdown.
messageTextA message to post in every locked channel.
visibleChoiceShow 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.

OptionTypeRequired
reasonTextReason for lifting the lockdown.
messageTextA message to post in every unlocked channel.
visibleChoiceShow 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.

OptionTypeRequired
amountNumberHow many to delete. Defaults to 10. From 1 to 100. Default: 10.
memberUserOnly delete messages from this member.
contentTextOnly delete messages with this text.
pinnedChoiceAlso delete pinned messages. Defaults to no. One of: Yes, No. Default: no.
botsChoiceOnly delete messages from bots. Defaults to no. One of: Yes, No. Default: no.
startTextID or link of the newest message to delete. Defaults to the latest.
endTextID 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.

OptionTypeRequired
memberUserDelete this member's messages.
linkTextDelete messages linking to this site, like scam.example.
contentTextDelete messages containing these words.
withinChoiceHow 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.
amountNumberMost messages to delete. Defaults to 250. From 1 to 1000. Default: 250.
pinnedChoiceAlso 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.

On this page