Skip to main content
The core private-message and reply loop is provider-validated. Group mentions, commands, reactions, and streaming are implemented in preview while their remaining provider validation is completed. Inbound media and Telegram voice transcription are supported independently of those preview features.
A Telegram Bot Distribution Ion connects one Telegram bot to an Ion Sequence. Private-chat messages, group messages, commands, replies, and reactions become shared A2A messaging events. Agent output returns to the same Telegram chat and topic by default. This distribution is for Telegram bots. It does not connect or operate as a person’s Telegram account.

Overview

The default Telegram Bot loop keeps platform behavior at the Distribution boundary:
  1. Telegram sends a supported update to the connected bot.
  2. The Distribution verifies and converts the update into a normalized A2A request.
  3. The Sequence handles the request and returns a response.
  4. The Distribution sends the response back into the same Telegram chat, topic, or reply chain.
This means the transport contract stays shared across distributions while the configuration layer remains platform-aware. For the lower-level contract, see Distribution and Event.

Default Request Loop

Configuration

Before you begin

You need:
  • an Aion organization and a Project containing a Telegram Bot Distribution Ion;
  • permission to add integrations to that organization; and
  • a Telegram account that can create a bot or supply an existing bot token.

Create an Aion-managed bot

This is the recommended setup path.
  1. Open Integrations, select Telegram Bot, then add a Telegram Bot account.
  2. Choose Create an Aion-Managed Bot.
  3. Enter the bot display name and optional profile details, then select Continue.
  4. Review and accept the ownership and management disclosures.
  5. Select Open Telegram and confirm bot creation in the manager chat.
  6. Return to Aion and wait for the Telegram Bot identity to become ready.
The Telegram user remains the bot owner. Aion receives management access needed to configure and operate that bot. Releasing the identity stops Aion routing, but it does not detach Aion’s manager relationship because Telegram does not provide that operation.

Connect your own bot

Use this path for a bot you created separately with @BotFather.
  1. Create the bot in Telegram and copy its Bot API token.
  2. Open Integrations, select Telegram Bot, then add a Telegram Bot account.
  3. Choose Connect Your Own Bot and submit the token through the one-time credential form.
  4. Wait for Aion to validate the bot and show the Telegram Bot identity as ready.
Treat the token as a secret. Aion does not display it again after submission.

Assign the bot to a Distribution

Connecting a bot does not automatically bind it to a Project or Distribution.
  1. Open the Project in Composer.
  2. Select the Telegram Bot Distribution Ion and open its Identity tab.
  3. Select the connected bot under Telegram Bot.
  4. To make this endpoint part of an Aion, select its Principal Identity.
  5. Sync the Project changes.
Telegram Bot v1 has no Distribution-specific behavior fields. Telegram privacy mode, group administration, and bot settings still determine which updates Telegram sends. Aion-managed setup does not change those settings automatically.

Activate the Distribution

After selecting a ready Telegram Bot identity, turn on Activate distribution and sync the Project. Activation registers the bot’s webhook and enables message delivery when reconciliation succeeds.

Message Mapping

Telegram Bot distributions map inbound and outbound messages through the same shared transport contracts used by other messaging integrations, while still preserving Telegram-specific chat and reply context. Inbound Outbound

Features

Voice messages

Telegram’s provider-designated voice message is eligible for automatic transcription. A forwarded or bot-created voice message receives the same treatment when Telegram still represents it as voice. Ordinary audio and document attachments are not transcribed automatically. Aion directly supports Ogg/Opus, MP3, and M4A voice content for recorded speech-to-text. It does not transcode an unsupported format. The file still reaches the agent with transcription.status = "unsupported" and safeFailureCode = "audio_format_not_supported_for_transcription". Other terminal STT failures likewise preserve the file and use a safe failure code without provider diagnostics. A no-speech result does not dispatch an agent request because it has neither provider caption nor usable transcript. When both are present, the provider-authored caption is the first text part and the generated transcript is the second. Only the caption and its Telegram entities can select a command; generated transcript text cannot turn a voice message into a command. Framework adapters preserve every part instead of flattening caption and transcript provenance.
Inspect every part in runtime.context.inbox.message.parts. Ordinary graph state receives all text parts in order, while the inbox preserves the file and the mediaId metadata needed to associate the transcript.
The file part’s MessageMediaPayload metadata carries fileId, the stable File Recording identifier, and fileVersionId, the exact immutable File Recordable identifier. Its URL and access and retention deadlines remain unchanged in task history. Supported Telegram media bytes are retained for one hour after materialization. The access grant may expire sooner; after byte retention ends, the historical URL returns 410 Gone without rewriting the task. Telegram’s standard hosted Bot API download limit is 20 MB. Aion does not apply a separate voice-duration limit, but download and STT work remain bounded by a size-aware processing deadline.

Attachments

Telegram audio and document messages receive normalized metadata and a temporary Aion file part. Aion downloads the content without exposing the bot token, validates bounded size and MIME/signature information, and streams the same ingress toward storage and any eligible STT consumer. Only voice is eligible for automatic transcription. The Aion file URL is authenticated and independent of Telegram’s credential-bearing download URL. Its one-hour byte retention and immutable task-history behavior match voice files. Outbound media delivery is not supported in this release; agent responses remain text, reactions, or supported structured messaging actions.

Mentions

Mentions in Telegram groups are treated as normal inbound message events. The framework sees text plus normalized transport context, and the response flows back into the same group context. Bot API 10.0 permits certain bot-authored messages in groups. Telegram Bot v1 intentionally ignores bot-authored input; bot-to-bot triggering is not supported.
The Distribution replies in the same Telegram chat and keeps the same reply context when one exists.

Commands

A leading Telegram bot_command entity is normalized as a command event. Commands may include an optional @botusername; the distribution accepts that form only when it names the connected bot. The raw argument tail and complete Telegram update remain available to the agent.

Reactions

Telegram delivers actor-specific reaction changes as message_reaction updates. In groups and supergroups, the bot must be an administrator and the webhook must explicitly request message_reaction. Anonymous aggregate message_reaction_count updates do not identify an actor and are not normalized into Aion reaction events. Each added or removed reaction becomes ReactionEventPayload with the original Telegram update preserved alongside it.
Agents can add or remove one supported non-paid bot reaction by emitting a ReactionActionPayload through the reserved aion:reaction artifact. The distribution validates the current chat and message before calling Telegram.

Cards

Cards are not planned for the Telegram Bot distribution. It does not interpret Distribution/Cards, Telegram Rich Messages, inline keyboards, or callback-button actions. Agents return plain text for Telegram responses.

Streaming

Telegram preserves one target context for the full response. In an eligible private chat, the distribution can show coalesced partial text through Telegram message drafts before sending the final message. In groups and supergroups, it posts once and applies rate-limited text edits. The Telegram Bot distribution controls the typing chat action while it waits for provider-visible output. No downstream A2A typing event is required, and a working task status alone does not activate typing.

DMs

Telegram private chats are the cleanest default request loop. The inbound message maps to trajectory = "direct-message" and the default outbound response goes right back to that chat.
Telegram Bot limitation: A bot cannot start a new private conversation. The user must first start or message the bot. Aion can reply in that established private-chat context, but an agent cannot use an arbitrary Telegram user ID to open a new DM.