> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# Telegram connector

- Connector: `appmixer.telegram`
- Version: 1.1.2
- Components: 16 (3 triggers, 13 actions)

Telegram Bot API connector. Send text, photos and documents to chats, groups and channels, edit, forward and delete messages, download files a user sent, inspect chats and administrators, and react in real time to incoming messages and inline-keyboard button presses.

- Connector page: <https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2>
- Documentation: <https://docs.appmixer.com/connector-configuration/telegram>
- Source code: <https://github.com/clientIO/appmixer-connectors/tree/dev/src/appmixer/telegram>
- Download package: <https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/download>

## Authentication

**Type:** API Key

**Fields:**

- `API ID` (text): Log in at _https://my.telegram.org_, open _API development tools_, create an application and copy its numeric _App api_id_.
- `API Hash` (password): The _App api_hash_ shown next to the API ID on my.telegram.org.
- `Session String` (password): A pre-generated user session for the API ID above. Create it once on your own machine by logging in with the teleproto library (_npm install teleproto_, then _client.start()_ and _client.session.save()_), which asks for your phone number, the login code and your 2FA password. The Telegram User page of the connector configuration guide has a ready-made script. The string grants full access to the Telegram account, so treat it as a password. Generate a session just for this connection and do not use the same string in another application at the same time - Telegram revokes a session that is used from two places at once. Use a dedicated account if possible.

## Triggers (3)

- [New Message](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.core.NewMessage.md) (`appmixer.telegram.core.NewMessage`): Triggers when the bot receives a message. Telegram allows only one webhook per bot, so every Telegram trigger of the same bot shares one registration created on flow start; stopping a flow leaves it in place because sibling flows may still need it. In groups the bot only sees messages addressed to it unless privacy mode is turned off in @BotFather.
- [New Channel Post](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.user.NewChannelPost.md) (`appmixer.telegram.user.NewChannelPost`): Triggers when a new post is published in one or more public Telegram channels. The channels are polled by message ID without joining them, so posts published while the connection to Telegram was down are delivered once it is back, in order and without duplicates. Starting the flow sets the starting point: only posts published after the start are delivered. Channels restricted in the account's region return no posts.
- [New Callback Query](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.core.NewCallbackQuery.md) (`appmixer.telegram.core.NewCallbackQuery`): Triggers when a user presses an inline-keyboard button attached to one of the bot's messages. Answer it with the Answer Callback Query action, otherwise the button keeps showing a loading indicator. Shares the single per-bot webhook registration with the other Telegram triggers.

## Actions (13)

- [Answer Callback Query](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.core.AnswerCallbackQuery.md) (`appmixer.telegram.core.AnswerCallbackQuery`): Acknowledges an inline-keyboard button press, optionally showing a toast or an alert to the user who pressed it. Telegram shows a loading indicator on the button until the query is answered, so pair this with the New Callback Query trigger. Answers are accepted for a short window after the press.
- [Edit Message](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.core.EditMessage.md) (`appmixer.telegram.core.EditMessage`): Replaces the text of a message the bot sent earlier. Telegram allows editing a bot message for up to 48 hours after it was sent, and returns the edited message.
- [Delete Message](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.core.DeleteMessage.md) (`appmixer.telegram.core.DeleteMessage`): Deletes a message from a chat. A bot can delete its own messages for up to 48 hours, and any message in a group only when it has the "Delete messages" admin right. This cannot be undone.
- [Forward Message](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.core.ForwardMessage.md) (`appmixer.telegram.core.ForwardMessage`): Forwards a message from one chat to another, keeping the original author attribution. The bot must be a member of both chats.
- [Get Chat](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.core.GetChat.md) (`appmixer.telegram.core.GetChat`): Retrieves up-to-date information about a chat: title, type, description, invite link, default member permissions and photo.
- [List Chat Administrators](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.core.ListChatAdministrators.md) (`appmixer.telegram.core.ListChatAdministrators`): Returns the administrators of a group, supergroup or channel, including the creator and each administrator's rights. Bots in the administrator list are omitted by Telegram. Returns the full list in one call - Telegram does not paginate this endpoint.
- [Make API Call](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.core.MakeApiCall.md) (`appmixer.telegram.core.MakeApiCall`): Performs an arbitrary authorized call against the Telegram Bot API. The path is the Bot API method name, so `/sendMessage` is enough - the bot token is added automatically. Use this to reach methods this connector does not expose as their own component.
- [Get File](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.core.GetFile.md) (`appmixer.telegram.core.GetFile`): Downloads a file a user sent to the bot and stores it for later steps. Takes the Telegram file ID emitted by the New Message trigger. Telegram only serves files up to 20 MB through this endpoint, and the download link it issues is valid for at least one hour.
- [Send Document](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.core.SendDocument.md) (`appmixer.telegram.core.SendDocument`): Sends a file to a Telegram chat. Provide either a public file URL or a Telegram file ID, or pick a stored file to upload. Bot uploads are capped at 50 MB by Telegram.
- [Send Message](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.core.SendMessage.md) (`appmixer.telegram.core.SendMessage`): Sends a text message to a Telegram chat, group or channel. Telegram caps a single message at 4096 characters; longer text is rejected with a 400.
- [Send Photo](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.core.SendPhoto.md) (`appmixer.telegram.core.SendPhoto`): Sends a photo to a Telegram chat. Provide either a public image URL or a Telegram file ID, or pick a stored file to upload. Uploads are capped at 10 MB by Telegram; photos must be at most 10000 pixels in total width plus height.
- [Find Channel Messages](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.user.FindChannelMessages.md) (`appmixer.telegram.user.FindChannelMessages`): Returns messages from a public Telegram channel, newest first, without joining it. Use it to backfill history: limit the number of messages, read only messages newer than a known message ID, or only messages published before a date. Channels restricted in the account's region return no messages.
- [Get Channel](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.user.GetChannel.md) (`appmixer.telegram.user.GetChannel`): Retrieves details of a public Telegram channel without joining it: title, description, subscriber count, and whether the channel is public, verified, or restricted.

## Changelog

### 1.1.2

- Security: upgraded form-data to 4.0.6 (predictable multipart boundary, CRLF injection in field names and filenames).

### 1.1.1

- MakeApiCall: Request Headers and Query Parameters set in the Designer are now sent. They were silently dropped: the key-value field stores its rows as a JSON object string, which the component did not parse.

### 1.1.0

- New Telegram User module (appmixer.telegram.user) that reads public channels as a user account through the official client API (MTProto), so channels the bot is not a member of can be read too. It connects with an API ID and API Hash from my.telegram.org and a pre-generated session string, and never joins the channels it reads.
- New Channel Post trigger: new posts in one or more public channels, polled by message ID so posts published while the connection to Telegram was down are delivered once it is back, in order and without duplicates. Only posts published after the flow starts are delivered.
- Find Channel Messages: channel history, newest first, with a limit, an after-message-ID filter and a before-date filter for backfill.
- Get Channel: title, description, subscriber count, and whether the channel is public, verified or restricted.
- Telegram flood control (FLOOD_WAIT) up to 60 seconds is waited out; longer waits are retried later instead of failing the flow. A private, misspelled or non-channel username is reported as an error.
- List Chat Administrators labels the nested user fields with the parent name ("User.Username") in the variable picker, like the other components.
- Store to CSV file output: the component no longer fails after the file is saved, values with a comma, a quote or a line break are quoted, and empty values stay empty instead of the word null.

### 1.0.1

- Output labels of nested fields now carry the parent name ("From.Username", "Chat.Username") so the variable picker can tell them apart; schemas mark which fields Telegram guarantees (required) and declare the real chat flags.
- DeleteMessage explains Telegram's default permission model (own messages only unless the bot is an admin with the Delete messages right) in the tooltip and in the error.
- NewMessage tooltip explains the default privacy mode in groups.
- Triggers no longer fail to start when two flows of the same bot start at once: the webhook registration is read first and only written when it differs, and a Telegram 429 on setWebhook is retried after the requested delay.

### 1.0.0

- Initial release.
