Telegram
ChannelConnect your agent to a Telegram bot for 1:1 and group chats.
At a glance
From Eve docs · synced Jul 22, 2026
Webhook route
POST /eve/v1/telegramEnvironment variables
- TELEGRAM_BOT_TOKEN
- replies, typing, callbacks, proactive sends
- TELEGRAM_WEBHOOK_SECRET_TOKEN
- must match the secret_token you register
Capabilities
- Human-in-the-loop — Human-in-the-loop (HITL) turns option requests into inline-keyboard buttons and freeform requests into ForceReply.
- Proactive sessions — Start a session without an inbound message through receive(telegram, { message, target, auth }) from a schedule run handler, or args.receive(telegram, ...) from another channel.
- Attachments — Inbound photos and documents are supported.
Derived from Eve's Telegram docs.
Install
Install the framework:
npm install eve@latestQuick start
Create agent/channels/telegram.ts:
// agent/channels/telegram.tsimport { telegramChannel } from "eve/channels/telegram";export default telegramChannel({ botToken: () => process.env.TELEGRAM_BOT_TOKEN!,});Configure
Create a bot with @BotFather, then register the webhook to point at eve's route (/eve/v1/telegram). Store the bot token in an environment variable. See the Telegram channel docs for group privacy and command setup.
How it behaves
Excerpts from Eve's Telegram docs. Prefer the source when something looks out of date.
Dispatch
In a private chat, text, captions, photos, and documents all go through. Groups are stricter. Only three things wake the bot: a command (/ask, /ask@my_bot), an @my_bot mention (when botUsername is set), or a reply to one of the bot's own messages. Everything else is ignored.
Forum topics carry message_thread_id in the continuation token, so each topic stays on its own thread.
To customize auth or filtering, override onMessage. Group privacy mode itself lives in BotFather, not here.
Delivery
The default message.completed handler sends plain text via sendMessage. It passes no parse_mode, so any Markdown shows up literally. Replies longer than Telegram's 4096-char limit are split across messages. Custom handlers use channel.telegram.
Human-in-the-loop (HITL)
Human-in-the-loop (HITL) turns option requests into inline-keyboard buttons and freeform requests into ForceReply. Telegram caps callback_data at 64 bytes, so eve keeps compact callback ids in channel state instead. It acknowledges its own callbacks with answerCallbackQuery; anything it doesn't recognize goes to onCallbackQuery.
Proactive sessions
Start a session without an inbound message through receive(telegram, { message, target, auth }) from a schedule run handler, or args.receive(telegram, ...) from another channel. target.chatId is required. Add messageThreadId to land in a specific forum topic.
Private proactive chats stay keyed to the chat, or to the chat plus messageThreadId when you target a topic. Group and supergroup proactive sends anchor to the bot message id returned by Telegram, so replies to different bot messages can resume different sessions in the same chat. If Telegram does not return a recognized chat type for an outbound send, eve keeps the session unanchored instead of guessing.
Attachments
Inbound photos and documents are supported. eve fetches them on demand via getFile, only when an upload policy allows the type:
export default telegramChannel({
botUsername: "my_bot",
uploadPolicy: { allowedMediaTypes: ["image/*", "application/pdf"], maxBytes: 10 * 1024 * 1024 },
});
Agents using Telegram
Chief of Staff (WhatsApp)
A pocket chief of staff: captures tasks from quick messages, tracks commitments, and remembers what matters across weeks.
Telegram Assistant Starter
Message a Telegram bot and it replies per your instructions. The blank canvas — edit instructions.md and nothing else.
Uptime Watch Starter
Checks one URL every 5 minutes and Telegram-alerts you only when it goes down or recovers.
Receipt Scanner Starter
Photo a receipt in Telegram and get merchant, total, category, and line items back. Demos attachments.