Guide Menu expand_more
telegram
OpenClaw Telegram Setup & Safety
Connect OpenClaw to Telegram safely using BotFather. Learn how to restrict access using dmPolicy and allowlists to prevent unauthorized usage.
Who this is for
This guide is for OpenClaw users who want to connect a Telegram bot to their Gateway to interact with AI models via chat.
Prerequisites
- An active Telegram account.
- Access to
@BotFatheron Telegram. - A running OpenClaw Gateway instance.
Why Telegram is risky out of the box
Telegram bots are publicly discoverable. If you build an OpenClaw bot that connects to a paid LLM API (like OpenAI or Anthropic) and you leave it unrestricted, anyone can message your bot and drain your API credits.
Configuration Steps
Create the Bot via BotFather
Message
@BotFatheron Telegram, send/newbot, and follow the prompts. Copy theHTTP API Tokenprovided.Add the Telegram Channel
Use the OpenClaw CLI to add Telegram. When asked for the token, paste it securely.
bash openclaw channel add telegramFind your Telegram User ID
To restrict the bot to yourself, you need your numeric Telegram User ID. You can find this by messaging
@userinfobotor using the OpenClaw logs when you send a test message.Update your configuration
Open your
claw.config.jsonand ensure yourallowlistarray contains your numeric User ID."channels": { "telegram": { "enabled": true, "token": "YOUR_BOT_TOKEN_HERE", "dmPolicy": "allowlist", "allowlist": [123456789] } }Restart the Gateway
Restart OpenClaw to apply the new access controls.
bash openclaw restart[OK] Telegram channel connected as @YourBotName
Bad Output / Common Mistakes
- Bot not replying at all: Check if you added the correct User ID. If your logs say “Rejected incoming Telegram message”, your security policy is working, but your ID is missing from the list.
- Error 409 Conflict: You have another script or server running the same bot token.
Rollback / Undo
If you need to disconnect the Telegram bot or suspect your token was compromised:
- Remove the channel:
bash openclaw channel remove telegram - Revoke the token: Message
@BotFather, select your bot, and chooseRevoke Tokento invalidate the old credentials.
When to ask for help
If your bot needs to operate in a group chat with complex permission requirements (e.g., only answering when mentioned, or only answering admins), setting up the right policy can be tricky. Request a Telegram Architecture Session for guidance.
Sources
- OpenClaw Docs - Telegram Integration: https://docs.openclaw.ai/channels/telegram (Checked on 2026-06-03)
- OpenClaw Docs - Channel Security: https://docs.openclaw.ai/gateway/security#channels (Checked on 2026-06-03)
ClawReady.in is an independent educational resource and setup service. It is not affiliated with, endorsed by, or operated by OpenClaw.