Locks¶
Info
This page is generated from the bot's built-in help (/help).
Locks stop certain kinds of content from being posted. Admins and approved users are never affected, so you can lock things like links or stickers and still let your team post them.
Commands¶
/lock<types...>: lock one or more types. Example:/lock url sticker./lock<types> ### <reason>: lock with a reason and a custom action, for example `/lock url ### No links allowed {tmute 1h}` or `/lock forward ### Forwards are spam `{warn}. Without an action the message is just deleted./unlock<types...>: unlock types./locks: show the active locks./locks listshows every type with its status./locktypes: list every type with a description./lockwarns<on/off>: when enabled, people hitting a lock get a warning (see Warnings). Locks with their own action ignore this.
Allowlist¶
Some locks accept exceptions:
- /allowlist: show the allowlist.
- /allowlist <items...>: add entries. url/button take a domain (subdomains included, path optional): example.com, youtube.com/watch. invitelink takes an exact link, a chat id or @username. inline/guestbot take a bot id or @username. anonchannel takes a channel id or @username. command takes /start. sticker takes stickerpack:<name> or a t.me/addstickers/... link; reply to a sticker with /allowlist stickerpack:<> to grab its pack automatically. emojicustom takes emojipack:<name> (or emojipack:<> while replying). forward locks take the forwarded user/channel id or @username.
- /rmallowlist <items...>: remove entries.
- /rmallowlistall: clear the allowlist (owner only).
Lock types¶
all every message
album media albums
anonchannel messages sent as a channel
audio audio / music
bot bots added by non-admins (kicked)
botlink bot links and deep links
button inline buttons
cashtag $cashtags
checklist checklists
cjk Chinese / Japanese / Korean text
command /commands
comment channel-post comments from non-members
contact shared contacts
cyrillic Cyrillic text
document files
email email addresses
emoji any emoji
emojicustom premium custom emoji
emojigame dice, darts, slots...
emojionly emoji-only messages
externalreply replies to messages from other chats
forward any forward
forwardbot forwards from bots
forwardchannel forwards from channels
forwardstory stories
forwarduser forwards from users
game games
gif GIFs
guestbot inline results from bots that are not in the chat
inline messages via inline bots
invitelink invite links and public chat links
location locations / venues
outsidereaction reactions from non-members
phone phone numbers
photo photos
poll polls
reaction reactions
rtl Arabic / Hebrew text
spoiler spoilers
sticker stickers
stickeranimated animated / video stickers
stickerpremium premium stickers
text plain text
url links
video videos
videonote round video notes
voice voice messages
zalgo glitchy stacked-diacritics text
Locks run before blocklists, so a locked message is handled by the lock. Note: Telegram does not let bots remove other people's reactions, so reaction locks apply the configured action (or a warning with /lockwarns) and log the event.
Commands¶
| Commands | Required right | |
|---|---|---|
/lock |
Lock message types (e.g. /lock url sticker) | change group info |
/unlock |
Unlock message types | change group info |
/locks |
Show the active locks | anyone |
/locktypes |
List every lockable type | anyone |
/lockwarns |
Warn users who hit a lock | change group info |
/allowlist (/whitelist, /lockallowlist) |
Allow domains, bots, channels or sticker packs through locks | change group info |
/rmallowlist (/rmwhitelist, /unallowlist) |
Remove allowlist entries | change group info |
/rmallowlistall (/rmwhitelistall) |
Clear the allowlist (owner) | group owner |