Telegram Message
Telegram Message makes your Telegram bot act in a chat: send a text, a photo, an audio file, a video, an animation, a document, a contact or a poll, and also delete, pin or unpin a message.
The most common use is replying: a Telegram Webhook starts the flow when someone writes to the bot, an agent prepares the answer and Telegram Message sends it to the same chat.
When to use it
- Replying to customers who write to your customer service bot.
- Sending a Telegram group the PDF report the flow has produced.
- Alerting your team about an urgent order or an incident.
- Running a quick poll in a group to agree on a date.
Configuration
This component needs the credential of the Telegram bot API service. In the Credential field (required), pick one with Choose an option or create one with Add new credential. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The credential of your Telegram bot. |
| Mode | Basic sends to the chat the triggering message came from, without you having to specify it. Advanced shows the Chat ID field and a few more options. Default: Basic. |
| Action | What the bot does: Send Text, Send Photo, Send Audio, Send Animation, Send Video, Send Document, Send Contact, Delete Message, Pin Message, Unpin Message or Send Poll. Default: Send Text. Depending on the action, the panel shows only the fields it needs. |
Fields by action
| Field | When it appears and what it does |
|---|---|
| Text | In Send Text it is the message that is sent; *bold* and _italic_ are applied, and if the text does not follow Telegram’s format it is sent as is. In the file actions (photo, audio, video, animation, document) it is the text that goes with the file. |
| Attachment | In the file actions. Connect the file you want to send, for example the one Pdf Writer produces, or the web address of a file. |
| Phone Number | In Send Contact. The contact’s phone number in international format, for example +34600000000. |
| First Name | In Send Contact. The contact’s first name. |
| Question | In Send Poll. The poll question. |
| Options | In Send Poll. The possible answers; add at least two. |
| Message ID | In Delete Message, Pin Message and Unpin Message. The number of the message you want to delete, pin or unpin. |
Advanced mode
With Mode set to Advanced, these fields appear:
| Field | What it does |
|---|---|
| Chat ID | The number of the Telegram chat to send to. Needed in this mode. |
| Message ID | In the send actions, the number of the message you want to reply to. Leave it empty to send a normal message. |
| Last Name | In Send Contact. The contact’s last name. Optional. |
| VCard | In Send Contact. Extra contact details in vCard format. Optional. |
| Multiple Answers | In Send Poll. Lets people choose several answers. Default: off. |
| Is Anonymus | In Send Poll. Hides who voted for each option. Default: off. |
Advanced options
| Field | What it does |
|---|---|
| Session ID | Identifies the conversation. Leave it empty: the platform uses the current conversation and the text sent is saved in its history. |
Batch processing
With the Batch Mode switch on, the component runs once for each item of the list you connect to Batch Input and returns all the results together as a list. Parallel Executions sets how many items are processed at the same time (1 to 5). Skip if Empty Batch Input skips the component when the list arrives empty, and Skip Branch if Empty Output stops the following components when the result is empty. More in Key concepts.
Using it as an agent tool
You can connect this component to an agent’s Tools input. In the Tool tab, Tool Name and Tool Description are the name and explanation the agent uses to recognise the tool and decide when to call it: write a clear description of what it does.
Output
Telegram Response returns the result of the action: when it succeeds, the action performed, the chat, the number of the message sent and the date. You can use that number, for example, to pin the message later with Pin Message.
Example
A training academy answers its students’ questions on Telegram:
- Telegram Webhook receives a student’s question.
- An agent looks up the answer in the course calendar.
- Telegram Message, with Mode set to Basic and Action set to Send Text, receives the agent’s answer in Text and sends it to the student’s chat.
Good practices
- In flows that reply to whoever writes to the bot, leave Mode on Basic: the message always goes back to the right chat.
- Use Advanced when the destination is fixed, for example your team’s group, and enter its Chat ID.
Related components
- Telegram Webhook: starts the flow with the messages your bot receives.
- Pdf Writer and Docx Writer: produce files to send as attachments.