Telegram is the most popular platform for running OpenClaw. This guide shows you how to create a Telegram bot, connect it to OpenClaw, and customize it for your needs.
Step 1: Create a Telegram Bot
Every Telegram bot starts with BotFather — Telegram's built-in bot creation tool.
- Open Telegram and search for @BotFather
- Send the command
/newbot - Choose a display name for your bot (e.g., "My AI Assistant")
- Choose a username ending in "bot" (e.g., "my_ai_assistant_bot")
- BotFather will give you a token like
123456789:ABCdefGHIjklMNOpqrsTUVwxyz
Save this token — you'll need it for OpenClaw configuration.
Step 2: Configure Your Bot's Profile
While still chatting with BotFather, customize your bot:
/setdescription — Add a description shown when users open the bot
/setabouttext — Brief text shown in the bot's profile
/setuserpic — Upload a profile picture for your bot
/setcommands — Define bot commands (e.g., /start, /help)
Step 3: Connect to OpenClaw
Add the Telegram bot token to your OpenClaw configuration:
{
"telegram_bot_token": "123456789:ABCdefGHIjklMNO",
"anthropic_api_key": "sk-ant-your-key",
"system_prompt": "You are a helpful personal assistant."
}
Start OpenClaw and the bot should come online within seconds.
Step 4: Test Your Bot
Open Telegram and find your bot by its username. Send a few test messages:
/start— should trigger a welcome message- "Hello, what can you do?" — should get a helpful response
- "Summarize the latest news about AI" — tests web search skill
- Send a photo — tests image understanding
Advanced: Group Chat Support
OpenClaw can work in Telegram group chats too. Add your bot to a group and configure how it responds:
- Mention-only mode — bot responds only when @mentioned
- All messages mode — bot reads everything and responds when relevant
- Command-only mode — bot responds only to /commands
Configure this in config.json under telegram.group_mode.
Advanced: Inline Mode
Enable inline mode to use your bot from any Telegram chat by typing @yourbotname query. The bot responds with suggestions right in the chat.
Troubleshooting
- Bot doesn't respond — check the token is correct and OpenClaw process is running.
- Slow responses — this depends on the AI model API. Claude typically responds in 2-5 seconds.
- "Unauthorized" error — regenerate the bot token via BotFather with
/revoke. - Bot works but stops after a while — make sure OpenClaw is running as a systemd service or using a process manager.
The Easy Way
With Clawby, you skip all the server configuration. Just paste your Telegram bot token into the dashboard, click Launch, and your bot is live in minutes. Automatic restarts, monitoring, and updates included.