Automate tasks with Telegram Bot
Bots are special Telegram accounts designed to handle messages automatically. Users can interact with bots by sending them command messages in private or group chats.
https://core.telegram.org/bots
Triggers
The trigger is the event that starts the automation.
-
Instantly if bot receives a text message
It is triggered every time a user sends a text message to the bot or to a group/channel where the bot is located.
- You can choose to trigger the task for any message received or only for those that are preceded by a specific command (a word).
-
Instantly if bot receives a command
It is triggered every time the bot receives a command.
-
Instantly if bot receives data from a Web App
It is triggered every time the bot receives data from a Telegra Web App.
-
Instantly if bot receives a voice message
It is triggered every time a user sends a voice message to the bot.
-
Instantly if bot receives an audio
It is triggered every time a user sends an audio file to the bot.
-
Instantly if a user presses a Telegram button
It is triggered every time a user clicks on the buttons attached to the posts of a chat.
- You can choose to trigger the task for a specific chat or for any chat where it has been displayed the button.
-
Instantly if bot receives a contact
It is triggered every time a user sends a contact from their address book to the bot.
- To send contacts to a bot, use the attach button in your Telegram application.
-
Instantly if bot receives an image
It is triggered every time a user sends an image to the bot.
-
Instantly if bot receives a message, image or file
It is triggered every the bot receives a text message, image or file to the bot.
-
Instantly if bot receives a video
It is triggered every the bot receives a video.
-
Instantly if chat receives a new member
It is triggered every time a new member joins in a group or super group where the bot resides.
Actions
The action is what happens automatically, without you having to do anything else.
-
Edit a message
Edit the text, image, video or file of a specific post.
-
Wait for user response
Task is paused and will resume once a response is received from the user.
-
Send a video
Send a video along with a description to a specific chat, group or channel.
- Supported video format: MP4.
- Maximum size 50 MB (Maximum established by Telegram in its API).
-
Send a new document
Send a document along with a description to a specific chat, group or channel.
- Supported document formats: GIF, PDF and ZIP.
- Maximum size 20 MB.
-
Restrict chat member
Restricts the operations that a user can perform on a supergroup.
- The bot must be an administrator in the supergroup.
-
Send a poll
Send a poll to the users of a chat.
-
Send a new message
Send a message, an image/video/document or both to a specific chat, group or channel.
- The following tags are currently supported in the messages: b, strong , i, em, u, ins, s, strike, del, a, code, pre.
- You can include URL Buttons and Callback Buttons in posts.
-
Ask user
Send a message (usually a question) that may include an image/video/file to a chat and wait for the user's response before continuing.
- The following tags are currently supported in the messages: b, strong , i, em, u, ins, s, strike, del, a, code, pre.
- You can include URL Buttons and Callback Buttons in posts.
-
Forward message
Forward a message from one group or channel to another.
- Service messages can't be forwarded.
- Forwarding messages from groups or channels requires that your bot is included in them and with administrator permissions (also to forward from other channels and public groups).
-
Copy message
Copy a message from one chat, group, or channel to another.
- Service messages cannot be copied.
- Copying messages requires your bot to be included in them and with administrator permissions (even to copy messages from other groups and public channels).
-
Delete a message
Delete a message from a specific chat including service messages, with the following limitations:
- A message can only be deleted if it was sent less than 48 hours ago.
- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
- Bots can delete outgoing messages in private chats, groups, and supergroups.
- Bots can delete incoming messages in private chats.
- Bots granted can_post_messages permissions can delete outgoing messages in channels.
- If the bot is an administrator of a group, it can delete any message there.
- If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
-
Get the URL of a file
Given a Telegram File Id, it returns the download URL.
- Telegram file download URLs are valid for one hour.
-
Reply to user
Reply to the message received from a user.
- The reply to messages is valid for both private chats, groups and channels.
- Reply can contain an image, video or file.
- The following tags are currently supported in the messages: b, strong , i, em, u, ins, s, strike, del, a, code, pre.
Featured articles
Telegram task automation with Botize
What is the response window or duration of conversations?
The duration of the conversation window refers to the time a user has to respond to a message sent by a chatbot. This period is 24 hours, which means that if the bot does not receive a response from the user within this timeframe, the conversation is considered finished.
Common Errors
Telegram requires you to indicate a Chat Id before executing this task
- Enter the 'Reply to user' step.
- Complete the 'Chat Id to reply' field by providing a valid chat Id or label.
Invalid Chat Id
The chat ID you specified in the automated task is not valid or does not correspond to an existing chat in Telegram with that code.
Edit your automated task and ensure that the chat ID is correct and corresponds to an existing chat in Telegram.
Bad Request: group chat was upgraded to a supergroup chat
This occurs when a Telegram group is converted into a supergroup, which changes its ID. To fix this, you need to edit your automated task and reconnect it to your group.