Table of contents
Create a Telegram Bot
- Open Telegram and search for @BotFather
- Send
/newbot - Follow prompts to name your bot and choose a username (must end in “bot”)
- Copy the bot token (looks like
1234567890:ABCdefGHIjklMNOpqrsTUVwxyz)
Login Command
Run the login command with your token:
openclaw channels login telegram --token YOUR_TOKEN
Replace YOUR_TOKEN with the token from BotFather.
Verify Connection
Send /start to your bot in Telegram. You should receive a welcome message.
Configure Allowlist
By default, anyone can message your bot. To restrict access, edit ~/.openclaw/openclaw.json:
{
"channels": {
"telegram": {
"allowFrom": ["@yourusername", "123456789"]
}
}
}
Use usernames or numeric user IDs. Use "*" to allow anyone.
Next Steps
- Getting Started Overview
- Allowlists and Sender Policies
- Daily Brief Workflow
- Telegram Setup Guide
- Telegram Troubleshooting
FAQ
Q: Can I use the same bot in multiple groups?
A: Yes. Add the bot to groups and configure channels.telegram.groups.
Q: How do I get my user ID?
A: Send /start to any bot (e.g., @userinfobot) to see your ID.
Q: What if I lose the token?
A: Revoke the old token in BotFather and create a new one.
Q: Can I disable inline mode?
A: Yes. Set channels.telegram.inlineMode: false.
Q: How do I disconnect?
A: Run openclaw channels logout telegram.