Connecting OpenClaw to Telegram is one of the most powerful things you can do with your AI agent setup. It lets you send commands, receive responses, and monitor your agent's activity directly from your phone or desktop Telegram client. But the integration involves multiple moving parts that all need to be configured correctly.
OpenClaw communicates with Telegram through the Telegram Bot API. Your OpenClaw instance acts as a bot server, receiving messages from Telegram users and responding through the bot. There are two connection modes: polling (OpenClaw periodically checks for new messages) and webhook (Telegram pushes messages to your OpenClaw server in real time). Webhooks are faster and more reliable for production use.
Open Telegram and search for @BotFather. Send the command /newbot and follow the prompts to name your bot and choose a username. BotFather will provide you with a bot token — a long string that looks like 123456789:ABCdefGHIjklMNOpqrSTUvwxyz. Copy this immediately and store it securely.
Open your OpenClaw config.yaml file and locate the Telegram integration section. Add your bot token and configure the connection mode.
telegram: enabled: true bot_token: "YOUR_BOT_TOKEN_HERE" mode: "webhook" # or "polling" webhook_url: "https://yourdomain.com/telegram/webhook" allowed_users: [] # Leave empty to allow all, or add Telegram user IDsFor webhook mode, Telegram needs to be able to reach your OpenClaw server over HTTPS. This requires a valid SSL certificate and a publicly accessible server. If you're running locally, use a tunneling service like ngrok for testing.
# Register your webhook with Telegram curl -X POST "https://api.telegram.org/botYOUR_BOT_TOKEN/setWebhook" \ -d "url=https://yourdomain.com/telegram/webhook"Start your OpenClaw instance and open a conversation with your bot in Telegram. Send a test message. If everything is configured correctly, OpenClaw will process the message and respond through the bot.
Always restrict your bot to specific Telegram user IDs using the allowed_users configuration. An unrestricted bot connected to a powerful AI agent is a significant security risk. Additionally, never expose your bot token publicly — if compromised, revoke it immediately through BotFather using /revoke.
Skip the troubleshooting. Our team handles installation, configuration, and repairs — guaranteed working setup.