Build a Telegram AI assistant in Rust
The Telegram adapter ships today in openclaw-channels: bridge Claude or GPT to a Telegram bot with allowlist access control and rule-based routing, no Node runtime.
- Wiring an LLM agent to a messaging channel usually means bespoke glue code.
- Exposing an agent bot without access control invites abuse.
- You want a provider you control — Anthropic or OpenAI — behind the bot.
- Telegram ships today
- The Telegram Bot API adapter is the reference channel implementation in openclaw-channels — it works now, not on a roadmap.
- Allowlist + routing built in
- The Channel / ChannelInbound / ChannelOutbound traits come with allowlist-based access control and rule-based routing, so only approved chats reach the agent.
- Bring your provider
- Back the assistant with Anthropic (Claude 3.5 Sonnet/Haiku/Opus) or OpenAI (GPT-4o/4/3.5) — same Provider trait, SSE streaming, tool use.
Telegram is the reference channel implementation in openclaw-rs. The
openclaw-channels crate defines the Channel, ChannelInbound, and
ChannelOutbound traits together with allowlist-based access control and
rule-based routing — and the Telegram Bot API adapter ships on top of them
today.
That means you can stand up a Telegram AI assistant without writing channel
glue: configure the bot token, set the allowlist of chats that are permitted to
reach the agent, and bind the assistant to a provider. Both Anthropic (Claude
3.5 Sonnet, Haiku, Opus) and OpenAI (GPT-4o, GPT-4, GPT-3.5) ship through the
same Provider trait, with SSE streaming and tool use.
Everything runs in the single openclaw binary — the gateway, the runtime, the sandbox, and the channel adapter — so there is no separate Node service to operate. Discord, Slack, Signal, Matrix, and WhatsApp adapters are on the channels roadmap and reuse the same trait surface.
How it works, step by step
- 1 Install and onboard
cargo install openclaw-cli, then openclaw onboard to set your provider credentials.
- 2 Configure the Telegram channel
Add your bot token and set the allowlist of chats permitted to reach the agent.
- 3 Pick a provider
Bind the assistant to Anthropic or OpenAI through the shared Provider trait.
- 4 Run the gateway
openclaw gateway run brings the bot online with routing and rate limiting active.
FAQ
- Which channels are available today?
- Telegram is the shipping reference adapter. Discord, Slack, Signal, Matrix, and WhatsApp are on the roadmap and follow the same Channel trait pattern.
- How do I stop strangers from using the bot?
- openclaw-channels includes allowlist-based access control and rule-based routing, so only approved chats reach the agent.