PanguBot › Overview
overview
Documentation

PanguBot — Telegram Group Management

A powerful, feature-rich Telegram group bot built on Cloudflare Workers. Everything you need to keep your groups safe, clean, and well-organised.

50+Commands
8Feature Areas
Groups Supported
🚫
Moderation
Ban, kick, mute, warn with reasons, temp-bans, and mod logs
🔍
Filters & Notes
Auto-replies, hashtag notes, saved content with media support
👋
Welcome System
Custom welcome/goodbye with variables, random variants, buttons
🔐
Captcha
Button or math captcha with auto-kick, custom text
🌊
Flood Control
Rate-limiting with configurable ban/kick/mute actions
🏛️
Federations
Cross-group ban sync across multiple communities
📋
Log Channel
Every mod action logged to a dedicated channel
🧹
Auto-Clean
Auto-delete service msgs, commands, and bot replies
💡

Use the sidebar to navigate by topic, or use the search box to find a specific command. Each command card expands to show syntax and examples — tap to open.

Quick Start
Get PanguBot running in your group in under 2 minutes.
  1. 1
    Add the bot — Search for @PanguBot on Telegram and add it to your group, or use the Add to Group button from the bot's profile.
  2. 2
    Make it admin — Go to Group Settings → Admins → Add Admin. Give it Delete Messages, Ban Users, and Restrict Members permissions at minimum.
  3. 3
    Test it works — Send /id in your group. The bot should reply with the chat ID and your user ID.
  4. 4
    Set up a welcome — Run /setwelcome Welcome {mention}! 👋 to greet new members automatically.
  5. 5
    Set your rules — Run /setrules followed by your group rules. Members can view them with /rules.
  6. 6
    Enable captcha (optional) — Run /captcha on to require new members to verify before chatting.
  7. 7
    Set up log channel (optional) — Create a channel, add the bot as admin there, then run /setlog @yourchannel in your group.
ℹ️

You can manage your group's notes, filters, and rules from a private chat with the bot using /connect [group_id]. This is handy for editing content without cluttering the group.

Variables & Buttons
Use dynamic variables and inline buttons in welcome messages, notes, filters, and posts.

Variables

These placeholders are replaced with real values when the message is sent.

VariableReplaced With
{first}User's first name
{last}User's last name (empty if none)
{fullname}First + last name combined
{username}@username, or full name if no username
{mention}Clickable name link (tg://user?id=…)
{name}Alias for {mention}
{id}User's numeric Telegram ID
{chatname}Group or chat title
{group}Alias for {chatname}

Random Variants

Separate multiple versions with %%% — the bot picks one randomly each time.

Welcome {mention}! Happy to have you! 🎉 %%% Hey {first}, glad you joined! 👋 %%% {mention} just joined — welcome aboard! 🚀

Inline Buttons

SyntaxDescription
[Text](buttonurl://https://url)Default grey URL button
[Text](buttonurl#primary://https://url)Blue button
[Text](buttonurl#blue://https://url)Blue button (alias)
[Text](buttonurl#danger://https://url)Red button
[Text](buttonurl#red://https://url)Red button (alias)
[Text](buttonurl#success://https://url)Green button
[Text](buttonurl#green://https://url)Green button (alias)
[Text](copytext://text to copy)Button that copies text to clipboard
💡

Put multiple buttons on the same line by placing them on the same row. Put them on separate lines to stack them vertically.

Multi-button Example
/setwelcome Welcome {mention} to {chatname}! 🎉 [📜 Rules](buttonurl#primary://https://t.me/c/123) [💬 Support](buttonurl://https://t.me/support) [📢 Channel](buttonurl#success://https://t.me/channel)
Ban & Kick
Remove users from your group permanently, temporarily, or just once.
ℹ️

All commands work by reply, @username, or user ID. Admins cannot be banned or kicked.

/banPermanently ban a user admin
Permanently bans a user. They cannot rejoin unless unbanned.
/ban [reply | @user | ID] [reason]
Examples
/ban @spammer Posting links
(reply to a message) /ban Rule violation
/tbanTemporarily ban a user admin
Bans a user for a set duration. They can rejoin after it expires. Supports m (minutes), h (hours), d (days).
/tban [reply | @user | ID] [duration]
Examples
/tban @user 30m
/tban @user 2h
(reply) /tban 3d
/unbanUnban a user admin
Removes the ban so the user can rejoin via invite link.
/unban [reply | @user | ID]
Example
/unban @user
/kickKick a user (can rejoin) admin
Removes the user from the group but does not ban them. They can rejoin via invite link immediately.
/kick [reply | @user | ID] [reason]
Example
/kick @user Spamming
/kickmeKick yourself from the group user
Any member can use this to remove themselves. They can rejoin via invite link.
Example
/kickme
Mute
Silence users without removing them from the group.
/muteMute a user admin
Prevents the user from sending any type of message. Add a duration to auto-unmute.
/mute [reply | @user | ID] [optional duration]
Examples
/mute @user
/mute @user 30m
(reply) /mute 2h
/unmuteUnmute a user admin
Restores all message permissions for the user.
/unmute [reply | @user | ID]
Example
/unmute @user
Warnings
A progressive discipline system — warn users and auto-action them when they hit the limit.
/warnWarn a user admin
Issues a warning. Shows current warn count and an inline button to remove the warn. When the user hits the limit, the configured action (ban/kick/mute) triggers automatically.
/warn [reply | @user | ID] [reason]
Examples
/warn @user Posting links
(reply to message) /warn Spamming
/dwarnWarn and delete the message admin
Reply to a message — warns the sender AND deletes that message in one go.
/dwarn [reason] (must reply to a message)
Example
(reply to message) /dwarn Inappropriate content
/swarnWarn silently (command deleted) admin
Warns silently — the /swarn command is deleted so members don't see the moderation action. If the warn limit is hit, a brief notice is sent.
/swarn [reply | @user | ID] [reason]
Example
(reply) /swarn Breaking rules
/unwarn / /rmwarnRemove last warning admin
Removes the most recent warning from a user. /rmwarn is an alias.
/unwarn [reply | @user | ID]
Example
/unwarn @user
/warnsView warnings for a user user
Shows all active warnings. Members can check their own warns without specifying a user.
/warns [reply | @user | ID]
Examples
/warns @user
/warns (shows your own)
/resetwarnsClear all warnings admin
/resetwarns [reply | @user | ID]
Example
/resetwarns @user
/setwarnlimitSet warn limit (default 3) admin
/setwarnlimit [number 1–100]
Example
/setwarnlimit 5
/setwarnmodeAction when limit is reached admin
Sets whether the user gets banned, kicked, or muted when they hit the warn limit.
/setwarnmode [ban | kick | mute]
Example
/setwarnmode ban
/setwarntimeSet warn expiry admin
Warnings older than this duration are automatically removed. Supports m, h, d, w. Use off to disable expiry.
/setwarntime [time | off]
Examples
/setwarntime 7d
/setwarntime 12w
/setwarntime off
/warnsettingsView current warn config admin
Shows current warn limit, action mode, and expiry setting.
Example
/warnsettings
/setwarnreactionReact to warned message admin
When enabled, the bot reacts with ⚠️ to the offending message when a user is warned via a reply.
/setwarnreaction [on | off]
Example
/setwarnreaction on
Locks
Block specific message types from being sent by regular members.
ℹ️

Approved users and admins bypass all locks. See the Approve section to whitelist trusted members.

/lockLock a message type admin
Messages of the locked type sent by regular members are automatically deleted.
/lock [type]
Available Types
sticker gif url forward bot audio voice video photo document poll location contact reaction
Examples
/lock sticker
/lock url
/lock reaction (disables all reactions group-wide)
/unlockUnlock a message type admin
/unlock [type]
Example
/unlock sticker
/locksList all active locks user
Example
/locks
Flood Control
Automatically action users who send too many messages too quickly.
/setfloodSet flood limit admin
Sets how many messages per 10 seconds triggers the flood action. Use off to disable.
/setflood [2–100 | off]
Examples
/setflood 5
/setflood off
/setfloodmodeAction on flood detection admin
Default is mute (5 minutes). Set to ban or kick for stricter enforcement.
/setfloodmode [ban | kick | mute]
Example
/setfloodmode ban
/floodShow flood settings user
Example
/flood
Blacklist
Automatically delete messages containing banned words and action the sender.
/blacklistAdd words to blacklist admin
Add one or more comma-separated words. Messages containing these words are deleted and the sender is actioned.
/blacklist [word1, word2, ...]
Examples
/blacklist spam
/blacklist badword1, badword2, offensive
/unblacklistRemove a word admin
/unblacklist [word]
Example
/unblacklist spam
/blacklistsShow all blacklisted words user
Example
/blacklists
/setblacklistmodeAction on trigger admin
Sets what happens when a blacklisted word is detected. Default is warn.
/setblacklistmode [warn | mute | kick | ban]
Example
/setblacklistmode ban
Filters
Set up keyword-triggered auto-replies with text, media, or buttons.
💡

Filters support media — reply to a photo/video/sticker/document with /filter keyword to save it as the reply.

/filterAdd a keyword auto-reply admin
When a member's message contains the keyword (or exact phrase in quotes), the bot replies automatically. Multi-word phrases must be quoted.
/filter [word] [reply text] /filter "multi word phrase" [reply text] (reply to media) /filter [word]
Examples
/filter hello Hi there! Welcome! 👋
/filter "good morning" Good morning everyone! ☀️
(reply to a photo) /filter rules
/filtersList all active filters user
Example
/filters
/stopRemove a filter admin
/stop [word or phrase]
Examples
/stop hello
/stop good morning
Notes
Save and retrieve content by name — text, photos, videos, and documents with optional buttons.
💡

Retrieve any note with #notename directly in chat — no command needed! E.g. just type #rules.

/saveSave a note admin
Saves text, or reply to a photo/video/document to save media. Supports inline buttons and variables.
/save [name] [content] (reply to message/photo/video) /save [name]
Examples
/save rules Please read the group rules! [📜 View Rules](buttonurl#primary://https://t.me/c/123)
(reply to a photo) /save banner
/save welcome Welcome {mention}! You're member #{id}.
/getRetrieve a note user
Retrieves a saved note. Alternatively, just type #notename in chat.
/get [name]
Examples
/get rules
#rules (inline shortcut)
/notesList all notes user
Lists all saved note names. Notes are shown as #name hashtag format.
Example
/notes
/delnoteDelete a note admin
/delnote [name]
Example
/delnote rules
Welcome & Goodbye
Greet new members and farewell departing ones with fully customised messages.
💡

Use variables like {mention}, {chatname} and %%% for random variants. See the Variables & Buttons page for all options.

/setwelcomeSet welcome message admin
Shown when a new member joins. Supports all variables, random variants (%%%), and inline buttons.
/setwelcome [message with optional buttons]
Example
/setwelcome Welcome {mention} to {chatname}! 🎉 Read the rules before chatting. [📜 Rules](buttonurl#primary://https://t.me/c/123) [💬 Chat](buttonurl://https://t.me/group)
/welcomeShow current welcome message admin
Example
/welcome
/clearwelcomeClear welcome message admin
Removes the custom welcome. The bot falls back to a default message.
Example
/clearwelcome
/setgoodbyeSet goodbye message admin
Shown when a member leaves. Supports all variables.
/setgoodbye [message]
Example
/setgoodbye Goodbye {mention}, we'll miss you! 👋
/goodbyeShow current goodbye message admin
Example
/goodbye
/cleargoodbyeClear goodbye message admin
Example
/cleargoodbye
/cleanwelcomeAuto-delete old welcome messages admin
When enabled, the previous welcome message is deleted each time a new member joins, keeping the chat clean.
/cleanwelcome [on | off]
Example
/cleanwelcome on
Captcha
Verify new members are human before they can chat.
⚠️

New members are muted until they complete verification. If they don't, you can configure the bot to kick them automatically.

/captchaEnable / disable captcha admin
/captcha [on | off]
Example
/captcha on
/captchamodebutton or math verification admin
button — member taps a button to verify (default).
math — member solves a simple arithmetic question (multiple choice).
/captchamode [button | math]
Example
/captchamode math
/captchakickKick if not verified in time admin
When enabled, users who don't complete the captcha within the kick time are automatically kicked.
/captchakick [on | off]
Example
/captchakick on
/captchakicktimeTime before auto-kick admin
Default is 5 minutes. Supports m, h, d.
/captchakicktime [time]
Example
/captchakicktime 10m
/captchamutetimeAuto-unmute after time admin
Auto-unmutes users even if they haven't solved the captcha. Use off to keep them muted until solved (recommended with captchakick).
/captchamutetime [time | off]
Example
/captchamutetime off
/setcaptchatextCustom button text admin
Customises the text on the verification button (button mode only).
/setcaptchatext [button text]
Example
/setcaptchatext ✅ Tap here to verify
/resetcaptchatextReset button text to default admin
Resets to default: "✅ I'm not a bot"
Example
/resetcaptchatext
/captchasettingsView all captcha settings admin
Example
/captchasettings
Anti-Raid
Automatically ban users during coordinated join floods.
⚠️

Anti-raid bans users who join when the join rate exceeds the threshold. The default threshold is 10 joins within the configured time window.

/antiraidEnable / disable anti-raid admin
/antiraid [on | off]
Example
/antiraid on
/antiraidtimeSet join window duration admin
Sets the time window in seconds for counting joins. Default is 60 seconds.
/antiraidtime [seconds 5–600]
Example
/antiraidtime 30
Approve
Whitelist trusted users so they bypass locks, flood control, and blacklist checks.
/approveApprove a user admin
Approved users bypass locks (sticker, URL, etc.), flood control, and blacklist checks.
/approve [reply | @user | ID]
Example
/approve @trusteduser
/unapproveRemove approval admin
/unapprove [reply | @user | ID]
Example
/unapprove @user
/approvedList approved users admin
Example
/approved
/settagSet a visible tag on a member admin
Sets a visible label shown next to a member's name in the group. Leave tag empty to remove it. Requires Bot API 9.5+ and restrict members permission.
/settag [reply | @user | ID] [tag text]
Examples
/settag @user VIP
(reply) /settag (removes tag)
Federations
Sync bans across multiple groups with a shared ban list.
ℹ️

Create a federation with /newfed, then share the Fed ID with other group admins so they can /joinfed. Anyone /fbanned is banned in all member groups.

Setup

/newfedCreate a federation admin
Creates a new federation and gives you a unique Fed ID to share.
/newfed [federation name]
Example
/newfed My Communities Network
/joinfedJoin a federation admin
/joinfed [fed_id]
Example
/joinfed ABC12345
/leavefedLeave current federation admin
Example
/leavefed
/delfedDelete your federation admin
Permanently deletes the federation. Only the owner can do this.
Example
/delfed
/renamefedRename your federation admin
/renamefed [new name]
Example
/renamefed New Network Name

Fed Bans

/fbanBan across all fed groups admin
Bans the user in every group that has joined the federation. You must be a fed admin.
/fban [reply | @user | ID] [reason]
Example
/fban @scammer Promoting scam links
/funban / /unfbanRemove fed ban admin
/funban [reply | @user | ID]
Example
/funban @user
/fedstatCheck a user's fed status user
Shows if a user is banned in the federation, or their role (owner/admin).
/fedstat [reply | @user | ID] [optional fedID]
Examples
/fedstat @user
/fedstat @user ABC12345

Admin Management

/fedpromotePromote to fed admin admin
Grants the user permission to use /fban and /funban across all fed groups.
/fedpromote [reply | @user | ID]
Example
/fedpromote @moderator
/feddemoteDemote fed admin admin
/feddemote [reply | @user | ID]
Example
/feddemote @user
/fedinfoShow federation info user
Shows the current federation name, ID, owner, member count, and ban count.
Example
/fedinfo
/fedadminsList fed admins user
Example
/fedadmins
Rules
Set group rules that members can view any time with /rules.
/setrulesSet group rules admin
Can also be run from a private chat connected to the group via /connect.
/setrules [rules text]
Example
/setrules 1. Be respectful 2. No spam or self-promotion 3. No NSFW content 4. English only 5. Follow Telegram TOS
/rulesShow group rules user
Example
/rules
/clearrulesClear rules admin
Example
/clearrules
Admin Tools
Pins, promotions, reactions, invites, slowmode, and more utility commands.

Pins

/pinPin a message (silently) admin
Reply to a message to pin it. Add loud to notify all members.
/pin /pin loud
Examples
(reply to message) /pin
(reply to message) /pin loud
/unpinUnpin the latest pinned message admin
Example
/unpin
/permapinSend a message and pin it admin
/permapin [message text]
Example
/permapin 📢 Welcome to the group! Read /rules first.

Promote & Demote

/promotePromote user to admin admin
Grants standard admin permissions (manage chat, delete messages, restrict members, pin messages, invite users).
/promote [reply | @user | ID]
Example
/promote @moderator
/demoteRemove admin permissions admin
/demote [reply | @user | ID]
Example
/demote @user

Reactions

/reactReact to a message admin
Adds an emoji reaction to the replied message. The /react command is deleted silently. Add big for an animated big reaction.
/react [emoji] /react [emoji] big
Examples
(reply) /react 🔥
(reply) /react 👍 big
(reply) /react ⚠️
/removereactionsRemove all reactions from a message admin
Clears all reactions from the replied message. Command is deleted silently.
Example
(reply to message) /removereactions

Slowmode & Invite

/slowmodeSet message rate limit admin
Sets Telegram's built-in slowmode. Use 0 to disable. Only specific values are valid.
/slowmode [0 | 10 | 30 | 60 | 300 | 900 | 3600]
Examples
/slowmode 30
/slowmode 0 (disable)
/linkGet or revoke invite link admin
Shows the current invite link. Use /link revoke to generate a new link and invalidate the old one.
/link /link revoke
Examples
/link
/link revoke

Disable / Enable Commands

/disableDisable a command in this group admin
Prevents the command from being used in the group. Silently ignores it when triggered.
/disable [command]
Example
/disable rules
/enableRe-enable a command admin
/enable [command]
Example
/enable rules
/disabledList disabled commands admin
Example
/disabled

Name Tracking & Info

/nametrackTrack name / username changes admin
When enabled, the bot announces in the group whenever a member changes their first name, last name, or username. Detection happens on their next message.
/nametrack [on | off]
Example
/nametrack on
/infoGet user info user
Shows name, ID, username, group status, and whether the user has a profile photo.
/info [reply | @user | ID]
Examples
/info @user
(reply) /info
/info (shows your own)
/adminlistList all group admins user
Shows owner and all admins with their custom titles if set.
Example
/adminlist
/chatinfoDetailed group info user
Shows title, ID, type, username, member count, admin count, description, slowmode, forum status, and linked chat.
Example
/chatinfo
/idGet chat and user IDs user
Shows the chat ID, your ID, and optionally the replied user's ID.
Examples
/id
(reply to user) /id
Clean & Purge
Delete messages, purge history, and auto-clean service messages and bot responses.

Delete & Purge

/delDelete a specific message admin
Reply to any message to delete it. The /del command is also deleted.
Example
(reply to message) /del
/purgeBulk delete messages admin
Reply to a message to delete from there up to the current message, or provide a count to delete the last N messages (max 100).
/purge (reply to start point) /purge [count 1–100]
Examples
(reply to message) /purge
/purge 20
/purgefrom → /purgetoPurge a range of messages admin
Mark the start with /purgefrom, then reply to the last message with /purgeto.
Example
(reply to first message) /purgefrom (reply to last message) /purgeto

Clean Service Messages

/cleanserviceAuto-delete service messages admin
Automatically deletes Telegram service messages. Enable specific types or use on for all.
/cleanservice on /cleanservice off /cleanservice [type1] [type2] ...
Available Types
join leave pin photo title videochat other
Examples
/cleanservice on (all types)
/cleanservice join leave
/nocleanserviceStop cleaning a service type admin
/nocleanservice [type | all]
Example
/nocleanservice pin
/cleanservicetypesList service types user
Example
/cleanservicetypes

Clean Command Messages

/cleancommandAuto-delete command messages admin
Automatically deletes command messages after handling. Types: admin (ban/mute/warn etc), user (get/info/id etc), other (unrecognised commands for other bots), or all.
/cleancommand [all | admin | user | other | off]
Examples
/cleancommand all
/cleancommand admin user
/cleancommand off
/keepcommandStop deleting a command type admin
/keepcommand [all | admin | user | other]
Example
/keepcommand admin
/cleancommandtypesList command types user
Example
/cleancommandtypes

Clean Bot Replies

/cleanmsgAuto-delete bot messages after 5 min admin
Bot messages of these types are automatically deleted 5 minutes after being sent. Types: action (ban/mute/kick notices), filter (filter replies), note (note replies).
/cleanmsg [all | action | filter | note | off]
Examples
/cleanmsg all
/cleanmsg action
/cleanmsg off
/keepmsgStop auto-deleting a message type admin
/keepmsg [all | action | filter | note]
Example
/keepmsg filter
/cleanmsgtypesList message types user
Example
/cleanmsgtypes

Post & Echo

/postSend a clean formatted post admin
Sends a clean message from the bot. Your /post command is deleted. Supports inline buttons, variables, and media (send a photo/video with /post as caption).
/post [message with optional buttons]
Examples
/post 📢 Server maintenance at 10pm UTC tonight!
/post 🎉 Giveaway time! [🎁 Enter](buttonurl#success://https://t.me/c/1) [ℹ️ Rules](buttonurl://https://t.me/c/2)
/echoBot repeats your text admin
Sends your text as a bot message. Your /echo command is deleted.
/echo [text]
Example
/echo Hello everyone! Welcome to the new members 👋

Report

/reportReport a message to admins user
Notifies all group admins by mention. Reply to the offending message.
Example
(reply to message) /report
/reportsEnable / disable reporting admin
/reports [on | off]
Example
/reports off
Log Channel
Forward all moderation actions to a dedicated Telegram channel.
ℹ️

Every ban, kick, mute, warn, flood action, and blacklist trigger is automatically sent to the log channel. You can set a per-group log channel for each group.

Setup Steps

  1. 1
    Create a Telegram channel (private is fine).
  2. 2
    Add PanguBot as an admin in that channel (needs only "Post Messages" permission).
  3. 3
    Get the channel ID by forwarding any message from it to @userinfobot, or use its @username.
  4. 4
    Run /setlog -1001234567890 (or /setlog @yourchannel) in your group.
/setlogConnect a log channel admin
/setlog [channel_id | @username]
Examples
/setlog -1001234567890
/setlog @mylogchannel
/unsetlogDisconnect log channel admin
Disconnects the log channel. A final notification is sent to the channel.
Example
/unsetlog
/logstatusCheck log channel connection admin
Shows the connected channel name and sends a test message to verify it is still working.
Example
/logstatus
Private Connect
Manage your group's notes, filters, and rules directly from a private chat with the bot.
💡

After connecting, you can use /save, /filter, /setrules, /notes, /filters, and /rules from PM without cluttering your group.

/connectConnect PM to a group user
Run this command in private chat with the bot. Get the group ID by running /id in your group first.
/connect [group_id]
Example
/connect -1001234567890
/disconnectDisconnect from group user
Example
/disconnect
/connectedShow connected group user
Shows the name and ID of the group your PM is currently connected to.
Example
/connected
Misc & Info
Bot info commands and developer-only broadcast tools.

General

/startIntroduction & feature overview user
Shows the bot welcome message in private chat with links to commands and documentation.
Example
/start (in PM)
/helpShow command list user
In a group, admins see the full admin help; members see the user help. In PM, shows the full command list.
Example
/help
/idGet chat and user IDs user
Shows the chat ID, your user ID, and optionally the replied user's ID.
Example
/id

Developer Commands

⚠️

These commands are only available to the bot developer in private chat. They are silently ignored for all other users.

/broadcastMessage all groups dev
Sends a message to every group the bot is in. Add --pin to pin in every group (with notification) or --silent to pin silently.
/broadcast [message] /broadcast [message] --pin /broadcast [message] --silent
Example
/broadcast New features available! Check /help.
/broadcast 🎉 Bot updated! --pin
/broadcastusersPM all bot users dev
Sends a private message to every user who has started the bot.
/broadcastusers [message]
Example
/broadcastusers Hey! Check out our new features.
/botstatsShow total groups & users dev
Example
/botstats
/groupsList all groups with member counts dev
Example
/groups
/usersList all user IDs dev
Example
/users
/backupCreate a full data backup dev
Exports all KV data as a JSON file. Reply to the backup file with /restore to restore it.
Example
/backup
/restoreRestore from a backup file dev
Reply to a .json backup file to restore all KV data. Shows a confirmation prompt before writing.
Example
(reply to backup .json file) /restore