All integrations

Telegram

Channel

Connect 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/telegram

Environment variables

TELEGRAM_BOT_TOKEN
replies, typing, callbacks, proactive sends
TELEGRAM_WEBHOOK_SECRET_TOKEN
must match the secret_token you register

Capabilities

  • Human-in-the-loopHuman-in-the-loop (HITL) turns option requests into inline-keyboard buttons and freeform requests into ForceReply.
  • Proactive sessionsStart a session without an inbound message through receive(telegram, { message, target, auth }) from a schedule run handler, or args.receive(telegram, ...) from another channel.
  • AttachmentsInbound photos and documents are supported.

Derived from Eve's Telegram docs.

Install

Install the framework:

npm install eve@latest

Quick 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