On this page
π Why Telegram?
| Advantage | Details |
|---|---|
| No public IP needed | Uses long-polling β works behind NAT, firewalls, on local machines. No port forwarding required. |
| 2-minute setup | BotFather gives you a token instantly. No app review, no business verification, no OAuth dance. |
| Rich media | Voice notes, images, files, stickers, location sharing, video β all supported natively. |
| Survives reboots | Token-based auth means you never need to re-scan QR codes (unlike WhatsApp). |
| Group support | Add your bot to groups with mention-based activation and per-group policies. |
| Cross-platform | Works on iOS, Android, desktop, and web β same bot everywhere. |
π€ Create a bot with BotFather
- Open Telegram and search for @BotFather (verify the blue checkmark)
- Send
/newbot - Choose a display name (e.g., βMy OpenClawβ)
- Choose a username ending in
bot(e.g.,my_openclaw_bot) - Copy the token (looks like
123456789:ABCdefGHIjklMNOpqrsTUVwxyz)
/revoke command.βοΈ Configure OpenClaw
Option A: During onboarding
Select βTelegram (Bot API)β when the wizard asks for a channel. Paste your token when prompted.
Option B: Manual config
// ~/.openclaw/openclaw.json
{
"channels": {
"telegram": {
"enabled": true,
"botToken": "123456789:ABCdefGHI...",
"dmPolicy": "pairing"
}
}
}
Option C: Environment variable
export TELEGRAM_BOT_TOKEN="123456789:ABCdefGHI..."
Then restart the gateway: openclaw gateway restart
openclaw channels login telegram. Just configure the token and start the gateway β it connects automatically via long-polling.π Pairing & allowlists
With dmPolicy: "pairing" (default), unknown users get a pairing code when they message your bot:
# Approve a pairing request
openclaw pairing approve telegram <code>
# List approved users
openclaw pairing list
# Revoke access
openclaw pairing revoke telegram <user-id>
Find your Telegram user ID
- DM your bot β check
openclaw logs --followβ look forfrom.id - Or message @userinfobot on Telegram
Switch to allowlist (skip pairing)
{
"channels": {
"telegram": {
"dmPolicy": "allowlist",
"allowFrom": ["123456789"]
}
}
}
dmPolicy: "open" unless you want anyone on Telegram to use your agent (and burn your API credits). See Security Guide.π₯ Group chats
Add your bot to a Telegram group, then configure access:
{
"channels": {
"telegram": {
"groups": {
"*": {
"requireMention": true
},
"-1001234567890": {
"requireMention": false,
"activation": "always"
}
}
}
}
}
The * wildcard applies to all groups. Override specific groups by their numeric ID.
/. If your bot must see all group messages, disable Privacy Mode via BotFather: /setprivacy β OFF. OpenClaw expects full message access by default.β¨ Telegram-specific features
| Feature | Status | Notes |
|---|---|---|
| Text messages | β Full | Markdown formatting, code blocks |
| Voice notes | β Full | Send and receive β great for hands-free use |
| Images / photos | β Full | Send and receive with captions |
| Files / documents | β Full | PDFs, spreadsheets, code files |
| Stickers | β Cached | Described once via vision, cached in sticker-cache.json |
| Video notes | β Full | Circular video messages (no captions, text sent separately) |
| Location sharing | β Full | Share and receive locations |
| Inline buttons | β Full | Agent can send interactive button responses |
| Reply threading | β Full | Maintains context in reply chains |
| Slash commands | β Full | /status, /model, /reset, etc. |
π Streaming & forum topics
v2026.3.2+: New Telegram setups default to live streaming (channels.telegram.streaming: "partial"). You see responses word-by-word in DMs and private chats without extra config.
Telegram forum-style private chats (Topics mode) also enable draft streaming β you see the agent's response appearing word by word instead of waiting for the full reply. This requires Bot API 9.3+ and a forum-enabled group.
For cron job delivery to forum topics, use the topic ID format:
--to "-100GROUPID:topic:TOPICID"
π¨ BotFather customization
Optional but recommended β makes your bot look professional:
/setuserpic β Upload a profile picture
/setdescription β "AI assistant powered by OpenClaw"
/setabouttext β Shown in the bot's profile
/setcommands β Register slash commands for autocomplete:
status - Show session status
model - Switch AI model
reset - Reset conversation
help - Show available commands
π§ Troubleshooting
| Problem | Fix |
|---|---|
| Bot doesn't respond | Check token is correct. Run openclaw logs --follow and send a message β look for errors. |
| 401 Unauthorized in logs | Token is wrong or revoked. Regenerate via BotFather /revoke and update config. |
| βplugin not foundβ error | Telegram is a built-in channel, not a plugin. Put config under channels.telegram, NOT plugins.entries.telegram. |
| Bot ignores group messages | Disable Privacy Mode: BotFather β /setprivacy β OFF. Or ensure messages @mention the bot. |
| Connection issues in Docker | Set env var OPENCLAW_TELEGRAM_DISABLE_AUTO_SELECT_FAMILY=true (required for image v2026.2.17+). |
| Old Moltbot/Clawdbot conflict | Kill old processes: ps aux | grep -E '(moltbot|clawdbot).*gateway'. Only one gateway should run. |
| Pairing code expired | Codes expire after 1 hour. Generate a new one by messaging the bot again. |