Telegram Bot API
Telegram
Telegram is one of the fastest ways to connect OpenClaw to a real chat surface. Long polling is the default, webhooks are optional, direct messages default to pairing approval and group chats usually activate on mention.
Quick Setup
1. Create a bot with @BotFather and copy the token.
2. Provide the token through TELEGRAM_BOT_TOKEN or channels.telegram.botToken.
3. Start the Gateway. Direct messages will usually produce a pairing code that you must approve.
4. If you need group support, configure channels.telegram.groups and mention rules next.
Common Config Snippets
Minimal config
{
channels: {
telegram: {
enabled: true,
botToken: "123:abc",
dmPolicy: "pairing"
}
}
} Allow all groups but require mentions
{
channels: {
telegram: {
groups: {
"*": { requireMention: true }
}
}
}
} Usage Notes
Group visibility depends on privacy mode
If the bot needs to see every group message, either disable BotFather privacy mode or grant it admin privileges.
Outgoing text uses Telegram HTML
OpenClaw converts common Markdown structures into safe Telegram HTML and falls back to plain text if Telegram rejects the markup.
Draft-style streaming is possible in DMs
In supported thread modes, Telegram direct messages can show partial output through draft bubbles while the reply is still streaming.
The most common failures are network problems
setMyCommands failed and sendMessage failures usually point to IPv6, DNS or outbound HTTPS connectivity instead of logic bugs.