Telegram
Status: production-ready for bot DMs + groups via grammY. Long polling is the default mode; webhook mode is optional.
Pairing
Default DM policy for Telegram is pairing.
Channel troubleshooting
Cross-channel diagnostics and repair playbooks.
Gateway configuration
Full channel config patterns and examples.
Quick setup
Step 1: Create the bot token in BotFather
Open Telegram and chat with @BotFather (confirm the handle is exactly @BotFather).Run /newbot, follow prompts, and save the token.
Step 2: Configure token and DM policy
{
channels: {
telegram: {
enabled: true,
botToken: "123:abc",
dmPolicy: "pairing",
groups: { "*": { requireMention: true } },
},
},
}
Env fallback: TELEGRAM_BOT_TOKEN=... (default account only). Telegram does not use openclaw channels login telegram; configure token in config/env, then start gateway.
Step 3: Start gateway and approve first DM
openclaw gateway
openclaw pairing list telegram
openclaw pairing approve telegram <CODE>
Pairing codes expire after 1 hour.
Step 4: Add the bot to a group
Add the bot to your group, then set channels.telegram.groups and groupPolicy to match your access model.
βΉοΈ Token resolution order is account-aware. In practice, config values win over env fallback, and
TELEGRAM_BOT_TOKENonly applies to the default account.
Telegram side settings
Access control and activation
curl "https://api.telegram.org/bot<bot_token>/getUpdates"Runtime behavior
- Telegram is owned by the gateway process.
- Routing is deterministic: Telegram inbound replies back to Telegram (the model does not pick channels).
- Inbound messages normalize into the shared channel envelope with reply metadata and media placeholders.
- Group sessions are isolated by group ID. Forum topics append
:topic:<threadId>to keep topics isolated. - DM messages can carry
message_thread_id; OpenClaw routes them with thread-aware session keys and preserves thread ID for replies. - Long polling uses grammY runner with per-chat/per-thread sequencing. Overall runner sink concurrency uses
agents.defaults.maxConcurrent. - Telegram Bot API has no read-receipt support (
sendReadReceiptsdoes not apply).
Feature reference
Troubleshooting
More help: Channel troubleshooting.
Telegram config reference pointers
Primary reference:
channels.telegram.enabled: enable/disable channel startup.channels.telegram.botToken: bot token (BotFather).channels.telegram.tokenFile: read token from file path.channels.telegram.dmPolicy:pairing | allowlist | open | disabled(default: pairing).channels.telegram.allowFrom: DM allowlist (numeric Telegram user IDs).allowlistrequires at least one sender ID.openrequires"*".openclaw doctor --fixcan resolve legacy@usernameentries to IDs and can recover allowlist entries from pairing-store files in allowlist migration flows.channels.telegram.actions.poll: enable or disable Telegram poll creation (default: enabled; still requiressendMessage).channels.telegram.defaultTo: default Telegram target used by CLI--deliverwhen no explicit--reply-tois provided.channels.telegram.groupPolicy:open | allowlist | disabled(default: allowlist).channels.telegram.groupAllowFrom: group sender allowlist (numeric Telegram user IDs).openclaw doctor --fixcan resolve legacy@usernameentries to IDs. Non-numeric entries are ignored at auth time. Group auth does not use DM pairing-store fallback (2026.2.25+).- Multi-account precedence:
- When two or more account IDs are configured, set
channels.telegram.defaultAccount(or includechannels.telegram.accounts.default) to make default routing explicit. - If neither is set, OpenClaw falls back to the first normalized account ID and
openclaw doctorwarns. channels.telegram.accounts.default.allowFromandchannels.telegram.accounts.default.groupAllowFromapply only to thedefaultaccount.- Named accounts inherit
channels.telegram.allowFromandchannels.telegram.groupAllowFromwhen account-level values are unset. - Named accounts do not inherit
channels.telegram.accounts.default.allowFrom/groupAllowFrom.
- When two or more account IDs are configured, set
channels.telegram.groups: per-group defaults + allowlist (use"*"for global defaults).channels.telegram.groups.<id>.groupPolicy: per-group override for groupPolicy (open | allowlist | disabled).channels.telegram.groups.<id>.requireMention: mention gating default.channels.telegram.groups.<id>.skills: skill filter (omit = all skills, empty = none).channels.telegram.groups.<id>.allowFrom: per-group sender allowlist override.channels.telegram.groups.<id>.systemPrompt: extra system prompt for the group.channels.telegram.groups.<id>.enabled: disable the group whenfalse.channels.telegram.groups.<id>.topics.<threadId>.*: per-topic overrides (group fields + topic-onlyagentId).channels.telegram.groups.<id>.topics.<threadId>.agentId: route this topic to a specific agent (overrides group-level and binding routing).channels.telegram.groups.<id>.topics.<threadId>.groupPolicy: per-topic override for groupPolicy (open | allowlist | disabled).channels.telegram.groups.<id>.topics.<threadId>.requireMention: per-topic mention gating override.- top-level
bindings[]withtype: "acp"and canonical topic idchatId:topic:topicIdinmatch.peer.id: persistent ACP topic binding fields (see ACP Agents). channels.telegram.direct.<id>.topics.<threadId>.agentId: route DM topics to a specific agent (same behavior as forum topics).
channels.telegram.capabilities.inlineButtons:off | dm | group | all | allowlist(default: allowlist).channels.telegram.accounts.<account>.capabilities.inlineButtons: per-account override.channels.telegram.commands.nativeSkills: enable/disable Telegram native skills commands.channels.telegram.replyToMode:off | first | all(default:off).channels.telegram.textChunkLimit: outbound chunk size (chars).channels.telegram.chunkMode:length(default) ornewlineto split on blank lines (paragraph boundaries) before length chunking.channels.telegram.linkPreview: toggle link previews for outbound messages (default: true).channels.telegram.streaming:off | partial | block | progress(live stream preview; default:partial;progressmaps topartial;blockis legacy preview mode compatibility). In DMs,partialuses nativesendMessageDraftwhen available.channels.telegram.mediaMaxMb: inbound/outbound Telegram media cap (MB, default: 100).channels.telegram.retry: retry policy for Telegram send helpers (CLI/tools/actions) on recoverable outbound API errors (attempts, minDelayMs, maxDelayMs, jitter).channels.telegram.network.autoSelectFamily: override Node autoSelectFamily (true=enable, false=disable). Defaults to enabled on Node 22+, with WSL2 defaulting to disabled.channels.telegram.network.dnsResultOrder: override DNS result order (ipv4firstorverbatim). Defaults toipv4firston Node 22+.channels.telegram.proxy: proxy URL for Bot API calls (SOCKS/HTTP).channels.telegram.webhookUrl: enable webhook mode (requireschannels.telegram.webhookSecret).channels.telegram.webhookSecret: webhook secret (required when webhookUrl is set).channels.telegram.webhookPath: local webhook path (default/telegram-webhook).channels.telegram.webhookHost: local webhook bind host (default127.0.0.1).channels.telegram.webhookPort: local webhook bind port (default8787).channels.telegram.actions.reactions: gate Telegram tool reactions.channels.telegram.actions.sendMessage: gate Telegram tool message sends.channels.telegram.actions.deleteMessage: gate Telegram tool message deletes.channels.telegram.actions.sticker: gate Telegram sticker actions β send and search (default: false).channels.telegram.reactionNotifications:off | own | allβ control which reactions trigger system events (default:ownwhen not set).channels.telegram.reactionLevel:off | ack | minimal | extensiveβ control agentβs reaction capability (default:minimalwhen not set).- Configuration reference - Telegram
Telegram-specific high-signal fields:
- startup/auth:
enabled,botToken,tokenFile,accounts.* - access control:
dmPolicy,allowFrom,groupPolicy,groupAllowFrom,groups,groups.*.topics.*, top-levelbindings[](type: "acp") - command/menu:
commands.native,commands.nativeSkills,customCommands - threading/replies:
replyToMode - streaming:
streaming(preview),blockStreaming - formatting/delivery:
textChunkLimit,chunkMode,linkPreview,responsePrefix - media/network:
mediaMaxMb,timeoutSeconds,retry,network.autoSelectFamily,proxy - webhook:
webhookUrl,webhookSecret,webhookPath,webhookHost - actions/capabilities:
capabilities.inlineButtons,actions.sendMessage|editMessage|deleteMessage|reactions|sticker - reactions:
reactionNotifications,reactionLevel - writes/history:
configWrites,historyLimit,dmHistoryLimit,dms.*.historyLimit