Telegram is one of the easiest platforms to integrate with OpenClaw thanks to its excellent Bot API. This guide walks you through creating an AI-powered Telegram bot in minutes.
Prerequisites
Before starting, ensure you have:
- OpenClaw installed and configured
- A Telegram account
- Your chosen LLM API key (Anthropic Claude or OpenAI)
Step 1: Create Your Telegram Bot
Telegram bots are created through the official BotFather bot:
- Open Telegram and search for @BotFather
- Start a chat with BotFather
- Send the command
/newbot - Follow the prompts to name your bot
- Choose a username (must end in 'bot')
- Save the API token BotFather provides
BotFather will output something like:
1234567890:ABCdefGHIjklMNOpqrsTUVwxyz
Step 2: Configure OpenClaw
Edit your OpenClaw configuration to add the Telegram integration:
# ~/.config/openclaw/config.yaml
integrations:
telegram:
enabled: true
botToken: "YOUR_BOT_TOKEN_HERE"
webhookUrl: "https://your-domain.com/webhook/telegram"
Step 3: Configure Polling or Webhook
OpenClaw supports two methods for receiving Telegram updates:
Option A: Polling (Easiest)
Polling is simpler to set up and works great for development:
# config.yaml
integrations:
telegram:
enabled: true
botToken: "YOUR_BOT_TOKEN"
mode: "polling" # Default, easiest setup
Option B: Webhook (Production)
Webhooks are more efficient for production deployments:
# config.yaml
integrations:
telegram:
enabled: true
botToken: "YOUR_BOT_TOKEN"
mode: "webhook"
webhookUrl: "https://your-domain.com/webhook/telegram"
Step 4: Start OpenClaw
With configuration complete, start the OpenClaw daemon:
# Start the daemon
openclaw daemon start
# Check logs to verify Telegram connection
openclaw daemon logs --follow
Step 5: Test Your Bot
In Telegram, find your bot by username and start a chat:
- Send
/startto initialize - Send a message like "Hello!"
- Your bot should respond with AI-generated text
Advanced Configuration
Custom Commands
Define custom slash commands for your bot:
# config.yaml
integrations:
telegram:
commands:
- command: "help"
description: "Show available commands"
response: "I'm an AI assistant! Ask me anything."
- command: "status"
description: "Check bot status"
action: "status_check"
Group Chat Support
Enable your bot in group chats:
# config.yaml
integrations:
telegram:
groupChats:
enabled: true
mentionTrigger: true # Only respond when mentioned
allGroups: false
allowedGroups:
- "My Group Chat"
- "AI Testing"
Multi-Agent Routing
Route different groups to different agents:
# config.yaml
routing:
telegram:
- match:
type: "group"
name: "coding-chat"
agent: "coding-assistant"
- match:
type: "group"
name: "writing-group"
agent: "writer-assistant"
Bot Features Available
OpenClaw's Telegram integration supports:
- Private messages: One-on-one AI conversations
- Group chats: AI assistance in group discussions
- Inline queries: AI suggestions as you type
- File uploads: Process documents and images
- Voice messages: Transcribe and respond to audio
- Rich formatting: Markdown responses with links, bold, etc.
Troubleshooting
Bot Not Responding
- Check daemon is running:
openclaw daemon status - Verify bot token is correct in config
- Check logs for errors:
openclaw daemon logs - Ensure LLM API key is valid
Webhook Verification Fails
- Verify webhook URL is publicly accessible
- Check SSL certificate is valid
- Ensure firewall allows incoming connections
Use Cases
OpenClaw on Telegram is perfect for:
- Personal Assistant: Quick AI help from your phone
- Group Helper: AI that assists your community
- Study Groups: Get answers without leaving the chat
- Language Practice: AI conversation partner
What's Next?
References
- OpenClaw Official Documentation - https://docs.openclaw.ai/ - Accessed February 2026
- OpenClaw GitHub Repository - https://github.com/openclaw/openclaw - Accessed February 2026
- Telegram Bot API Documentation - https://core.telegram.org/bots/api - Accessed February 2026
- Telegram BotFather Guide - Creating a New Bot - Accessed February 2026
Build your AI bot today
Create an intelligent Telegram bot with OpenClaw in just a few minutes.
Get StartedReference Trail
External sources surfaced from the underlying article content
- https://docs.openclaw.ai/docs.openclaw.ai
- https://github.com/openclaw/openclawgithub.com
- https://core.telegram.org/bots/apicore.telegram.org
- Creating a New Botcore.telegram.org