Skip to content

Lock Types

This page documents all available lock types in the Locks module. Locks allow administrators to restrict specific types of content or actions in their groups.

  • Total Lock Types: 22
  • Permission Locks: 16 (specific content types)
  • Restriction Locks: 6 (broad categories)

Locks prevent non-admin users from posting specific types of content. When a lock is enabled, the bot will automatically delete matching messages from regular users.

/lock <lock_type> [lock_type2 ...]
/unlock <lock_type> [lock_type2 ...]
/locks - View all currently enabled locks
/locktypes - View all available lock types

Restriction locks affect broad categories of messages. These are powerful locks that can block multiple content types at once.

Lock TypeDescription
allBlocks all messages from non-admins
commentsBlocks messages from non-members (discussion comments)
mediaBlocks all media files (audio, document, video, photo, video note, voice)
messagesBlocks all text and media messages
otherBlocks games, stickers, and GIFs
previewsBlocks messages with URL previews

Permission locks target specific types of content or actions. Use these for fine-grained control over what users can post.

Lock TypeDescription
anonchannelBlocks messages from anonymous channels and linked channel posts
audioBlocks audio file messages
botsPrevents non-admins from adding bots to the group
contactBlocks contact card messages
documentBlocks document files (excludes GIFs/animations)
forwardBlocks forwarded messages
gameBlocks game messages
gifBlocks GIF/animation messages
locationBlocks location/venue messages
photoBlocks photo messages
rtlBlocks messages containing right-to-left (Arabic) text
stickerBlocks sticker messages
urlBlocks messages containing URLs
videoBlocks video messages
videonoteBlocks video note messages (round videos)
voiceBlocks voice messages

These locks control specific types of media content:

  • photo: Blocks photo messages
  • video: Blocks video messages
  • audio: Blocks audio file messages
  • voice: Blocks voice messages
  • document: Blocks document files (excludes GIFs/animations)
  • gif: Blocks GIF/animation messages
  • sticker: Blocks sticker messages
  • videonote: Blocks video note messages (round videos)

These locks control how content behaves:

  • forward: Blocks forwarded messages
  • url: Blocks messages containing URLs
  • previews: Blocks messages with URL previews
  • rtl: Blocks messages containing right-to-left (Arabic) text
  • anonchannel: Blocks messages from anonymous channels and linked channel posts
  • comments: Blocks messages from non-members (discussion comments)

Prevents non-admins from adding bots to the group

Behavior: When enabled, the bot will automatically ban any bot added by non-admins.

Blocks all messages from non-admins

Use Case: Useful for temporarily freezing chat activity or creating read-only channels.

/lock media

Blocks all media files (audio, documents, videos, photos, video notes, and voice messages).

/lock all

Prevents all non-admin users from sending any messages.

/lock forward

Prevents users from forwarding messages from other chats.

/lock bots

Only admins can add bots to the group.

/lock sticker gif video

Lock multiple content types in a single command.

All locks automatically exempt administrators. Admins can always post any content type, regardless of which locks are enabled.

The bot requires the following permissions to enforce locks:

  • Delete Messages: Required to remove locked content
  • Ban Users: Only for the bots lock (to ban unauthorized bot additions)

Locks work independently but complement other moderation modules:

  • Antiflood: Locks control content types, antiflood controls message frequency
  • Filters: Custom filters can block specific words/patterns, locks block content types
  • Blacklist: Blacklist blocks specific words, locks block entire categories
  • /lock <type> - Enable one or more locks
  • /unlock <type> - Disable one or more locks
  • /locks - View currently enabled locks
  • /locktypes - View all available lock types

For more information, see the Locks module documentation.