Telegram component

Telegram

The Telegram Component enables seamless interaction with the Telegram Bot API.

Description

The Telegram Component enables seamless interaction with the Telegram Bot API. This component has been tested with API version 7.0.

Credentials

To utilize this component, you must first create a Bot by adhering to these guidelines.

Required credential fields for the component are as follows:

  • Token (string, required): This field should contain the token generated by @BotFather.
  • Webhook secret token (string, optional): Use this field to validate requests that come to the webhook. Only characters A-Z, a-z, 0-9, _ and - are allowed. Leave blank to skip validation.

Triggers

Webhook

Creates Webhook for selected event types to receive incoming updates.

Configuration Fields

  • Update types - (multi-select dropdown, optional): Select the update types you want to receive. Leave blank to receive all except chat_member, message_reaction, and message_reaction_count (default). Currently, the component supports the following types:

    • message - New incoming message of any kind - text, photo, sticker, etc.
    • edited_message - New version of a message that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot.
    • channel_post - New incoming channel post of any kind - text, photo, sticker, etc.
    • edited_channel_post - New version of a channel post that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot.
    • message_reaction - A reaction to a message was changed by a user. The bot must be an administrator in the chat. The update isn’t received for reactions set by bots.
    • message_reaction_count - Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat. The updates are grouped and can be sent with delay up to a few minutes.
    • inline_query - New incoming inline query.
    • chosen_inline_result - The result of an inline query that was chosen by a user and sent to their chat partner.
    • callback_query - New incoming callback query
    • shipping_query - New incoming shipping query. Only for invoices with flexible price
    • pre_checkout_query - New incoming pre-checkout query. Contains full information about checkout
    • poll - New poll state. Bots receive only updates about manually stopped polls and polls, which are sent by the bot
    • poll_answer - A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.
    • my_chat_member - The bot chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.
    • chat_member - A chat member’s status was updated in a chat. The bot must be an administrator in the chat.
    • chat_join_request - A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates.
    • chat_boost - A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates.
    • removed_chat_boost - A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates.

Output Metadata

An object that represents an incoming update

Limitations

  • One bot supports only one Webhook at the same time. If you run a second flow with webhook using the same bot credentials it will overwrite the existing one.
  • This trigger doesn’t support Retrieve sample functionality, use Generate Stub Sample instead.
  • If you’re using the ordinary flow (without real-time enabled) and it’s already underway, simply execute it once by following the provided webhook URL to initiate the first run. This will establish a webhook subscription. Any errors encountered during this initial execution can be ignored.

Actions

Send File

This action allows for the transmission of files of specified types. There are limitations based on the file type: up to 10 MB for photos, 50 MB for other file types, and no size limit when utilizing the file_id of an existing file.

Configuration Fields

  • File type - (dropdown, required): Choose the file type you wish to send. Supported file types include:
    • Photo - Photos must not exceed 10,000 in total width and height, with a maximum aspect ratio of 20.
    • Audio - Audio files must be in .MP3 or .M4A formats.
    • Document - You can send files of any type, up to 50 MB.
    • Video - Supports MPEG4 format videos (other formats can be sent as Document).
    • Animation - For sending animation files (GIF or H.264/MPEG-4 AVC videos without sound).
    • Voice - To send audio files as playable voice messages, files must be in .OGG format encoded with OPUS (other formats can be sent as Audio or Document).
    • VideoNote - For sending rounded square MPEG4 videos up to 1 minute long.

Input Metadata

Fields are automatically generated based on the selected File type.

Output Metadata

Includes the result of the file send operation, such as the message id.

Send Message

Enables sending text messages to a chat or channel.

Configuration Fields

There’s no Additional Configuration fields.

Input Metadata

  • Chat id - (string, required): The unique identifier for the target chat or the username of the target channel (formatted as @channelusername).
  • Text - (string, required): The message text, which can contain 1-4096 characters post entities parsing.
  • Message Thread ID - (number, optional): Identifies the message thread (topic) within forum supergroups.
  • Parse Mode - (string, optional): Specifies the text formatting option, with choices including MarkdownV2, HTML, and Markdown. Refer to formatting options for more information.
  • Entities - (array, optional): A list of MessageEntity for special text entities. This can substitute for parse_mode.
  • Link Preview Options - (object, optional): Controls link preview generation with options such as disabling previews, specifying URLs, and adjusting media sizes and positions.
    • Is Disabled - (boolean, optional): Indicates whether the link preview is disabled (set to true if disabled).
    • URL - (string, optional): The URL to use for the link preview. If left empty, the first URL found in the message text will be used.
    • Prefer Small Media - (boolean, optional): Set to true to shrink the media in the link preview. This is ignored if the URL isn’t explicitly specified or if media size change isn’t supported for the preview.
    • Prefer Large Media - (boolean, optional): Set to true to enlarge the media in the link preview. This is ignored if the URL isn’t explicitly specified or if media size change isn’t supported for the preview.
    • Show Above Text - (boolean, optional): Determines the position of the link preview relative to the message text. Set to true to show the link preview above the message text.
  • Disable Notification - (boolean, optional): Sends the message without sound for a silent notification.
  • Protect Content - (boolean, optional): Prevents message forwarding and saving.
  • Reply Parameters - (object, optional): Specifies details for replying to messages, including message and chat IDs, and options for sending without a reply, quoting, and specifying quote formats and positions.
    • Message ID - (string, optional): The identifier of the message to be replied to in the current chat, or in the chat identified by chat_id if specified.
    • Chat ID - (string, optional): If the message to be replied to is from a different chat, this is the unique identifier for the chat or the username of the channel (in the format @channelusername).
    • Allow Sending Without Reply - (boolean, optional): Set to true if the message should be sent even if the specified message to be replied to is not found. This can be used only for replies in the same chat and forum topic.
    • Quote - (string, optional): The quoted part of the message to be replied to, consisting of 0-1024 characters after entities parsing. The quote must be an exact substring of the original message, including entities. The message will fail to send if the quote isn’t found in the original message.
    • Quote Parse Mode - (string, optional): The mode for parsing entities in the quote. Options include MarkdownV2, HTML, and Markdown.
    • Quote Entities - (array, optional): An array of MessageEntity, which is a JSON-serialized list of special entities that appear in the quote. This can be specified instead of quote_parse_mode.
    • Quote Position - (number, optional): The position of the quote in the original message in UTF-16 code units.
  • Reply Markup - (object, optional): InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, or ForceReply. Additional interface options for an inline keyboard, custom reply keyboard, instructions to remove the reply keyboard, or to force a reply from the user.

Output Metadata

The result of sending the message, including the message id.

Make Raw Request

Allows for the execution of custom requests using the Telegram REST API directly.

Configuration Fields

  • Don’t throw an error on 404 Response - (optional, boolean): Configures the handling of 404 HTTP responses as non-errors. Default is false.

Input Metadata

  • Url - (string, required): The relative path of the resource, appended to the base URL https://api.telegram.org/bot<token>/.
  • Method - (string, required): Specifies the HTTP method for the request, either GET or POST.
  • Request Body - (object, optional): The body content for the request.

Output Metadata

  • Status Code - (number, required): The HTTP response status code.
  • HTTP headers - (object, required): The response’s HTTP headers.
  • Response Body - (object, optional): The body of the HTTP response.