โ๏ธ Telegram Bot Setup
The easiest channel to get started with OpenClaw
Why Telegram?
Telegram is the easiest channel to set up with OpenClaw. It takes about 2 minutes, requires no special hardware or phone number verification, and works great on mobile. Most users start here.
Create a Bot with BotFather
Open Telegram and search for @BotFather, then:
- Start a chat with @BotFather
- Send
/newbot - Enter a name for your bot (e.g., "My OpenClaw")
- Enter a username ending in "bot" (e.g., "myopenclaw_bot")
- BotFather gives you a token โ save this!
Get Your Telegram User ID
You need your numeric user ID to whitelist yourself. Search for @userinfobot on Telegram and send it any message:
Save this ID โ you'll use it to configure allowed users.
Configure OpenClaw
Add the Telegram channel to your OpenClaw config:
# If using the onboard wizard, it will ask for these # Or add manually to ~/.openclaw/config.yaml: channels: telegram: token: "7123456789:AAHxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" allowedUsers: - "123456789" # Your Telegram user ID
Or configure via CLI:
openclaw channels add telegram \ --token "7123456789:AAHxxxxxxx" \ --allowed-users "123456789"
Start OpenClaw
# Start the gateway openclaw gateway # Or if running as daemon openclaw gateway start
Message Your Bot!
Find your bot on Telegram (search for @yourbotusername) and send it a message:
๐ That's It!
Your Telegram bot is now connected to OpenClaw. Every message you send goes to your local AI assistant.
Optional Customizations
Set a Profile Photo
Make your bot look nicer in Telegram:
- Open @BotFather
- Send
/setuserpic - Select your bot
- Send an image (square works best)
Set a Description
Add a description that shows when users first open your bot:
- Open @BotFather
- Send
/setdescription - Select your bot
- Enter a description
Allow Multiple Users
Add family members or friends to the allowed list:
channels:
telegram:
token: "your-token"
allowedUsers:
- "123456789" # You
- "987654321" # Family member
- "555555555" # Friend
Add to a Group Chat
You can add your bot to a Telegram group:
- First, enable group mode with @BotFather:
/setjoingroupsโ Enable - Add your bot to the group
- By default, bots only see messages starting with
/or @mentions - To see all messages:
/setprivacyโ Disable
โ ๏ธ Group Chat Security
In group chats, be careful what tools you enable. Consider using sandbox mode to limit what OpenClaw can do when triggered by group messages.
Troubleshooting
Bot doesn't respond?
# Check if OpenClaw is running openclaw status # Check logs for errors openclaw logs -f # Verify token is correct curl "https://api.telegram.org/botYOUR_TOKEN/getMe" # Should return your bot's info
Bot responds to others but not you?
Your user ID might not be in the allowedUsers list. Double-check the ID with @userinfobot and update your config.
"Unauthorized" error?
Your bot token is invalid or has been revoked. Get a new token from @BotFather using /revoke then /token.
Related Guides
- Security Checklist โ Secure your installation
- Raspberry Pi Setup โ 24/7 always-on assistant
- Quick Start Guide โ Full setup walkthrough