How to create a Telegram bot
This article covers how to connect your Telegram bot and provides the fundamentals for working with channels and groups.
Telegram requirements & limits
1. Message limits
Text-only message: Maximum of 4,096 characters.
Message with an image: Maximum of 1,024 characters (for a 1080x1080 px image).
2. Image requirements
Format: Square images are preferred.
Optimal size: 900x900 pixels, maximum 5 MB.
3. File requirements
The Telegram API has specific requirements for uploaded files:
Bots can send files up to 2 GB.
You can use file_id to work with previously uploaded files. In this case, file limits follow the Telegram documentation.
Files can be sent using a URL (the bot downloads and sends it):
Photos: ≤ 5 MB
Other files: ≤ 20 MB
Different limits apply for posting:
Photos: 10 MB
Other files: 2 GB
Telegram bot creation
A Telegram bot is created through BotFather, Telegram's official bot management system. This verified tool (indicated by a blue checkmark) allows you to create a bot without any programming knowledge and protects you from fraudulent imitators.
Creation Steps:
Start a chat with BotFather.
Send the command:
/newbotChoose a name for your bot (this is the display name for users).
Choose a username for your bot. It must end with
botor_bot(e.g.,my_test_bot).
If the username is available, BotFather will send you a confirmation message containing a "token"—a unique key for API access.
Important: This token is a password for your bot. Save it securely and never share it with anyone.

Navigate to the Messengers section, select Telegram, and paste your bot's token into the provided field.

Click the Done button to complete the bot setup and activate the connection to your project.
Working with Telegram groups/channels
Useful information
A Telegram group is a communication channel between participants: all participants can write in it.
The Telegram channel is a one-way means of communication. Only the owner or administrators can send messages, while the rest of the participants can only view them and leave comments.
How to add a bot to a Telegram group/channel
This feature for the bot is included in BotFather:
Step 1. Go to the bot settings:

Step 2. Click on "Allow Groups?'

Step 3. There should be an enabled status.

Add a bot as an administrator in a group/channel
In order to automate work in chats and channels, you need to add your own bot as an Administrator.
How to do it?
Step 1. Go to Group/Channel Management and select the Administrators tab

Step 2. Click the "Add Admin" button.

Step 3. Enter your bot's username in the search box.

Step 4. For full functionality, ensure the bot has the rights to read and delete messages.

Variables for working in chats
Please note!
Saving variables in group chats for events such as joining a chat, exiting a chat, new like, etc. is not available.
Variables will be available only inside the block that has worked. You can output these variables in the block to track the work.
This WILL NOT affect the operation of chatbots in any way, it will be impossible to track who entered/exited in the clients section.
Variables with information about the author of the message
message_from - the ID of the message author
message_from_name - the name of the message author
message_from_username - the nickname of the message author in the Telegram

Variables with information about the forwarded message
reply_message_id - the number of the message being forwarded
reply_from - who is the author of the forwarded message
reply_from_name - the name of the person whose message is being forwarded
reply_from_username - the nickname of the person whose message is being forwarded
reply_from_chat_id - the number of the dialog from which the message was forwarded
Adding and removing from a group
In this case, the new_chat_member and left_chat_member callbacks are triggered (variables are not saved in the client's card):
chat_member_name - username
chat_member_username - user's nickname
chat_member_id - user's number
Callbacks in Telegram
client_unsubscribed - the client has unsubscribed, blocked the bot
client_returned - the client has unblocked the bot

Callbacks in groups/channels
new_chat_member - a new user has been added
left_chat_member - the user left the channel
kicked_chat_member - the user was deleted by the administrator
chat_join_request - a request has been received to add to the channel
edited_channel_post - the post on the channel has been edited (edited_channel_post + date and time of editing)



Callbacks are displayed in the Clients section
bot_added_to_group - a bot has been added to the chat (it doesn't matter which one, it will respond to anyone, even if the connected bot was added to the group itself);
bot_left_group - a similar callback is removing the bot from the channel;
new_like - liked the post
like_deleted - deleted a like from the post


The number in the callback (new_like; like_deleted) is the ID of the message that was responded to or removed from.
Please note!
Callbacks for reactions are not displayed in Telegram channels! Callbacks for reactions come only in groups.
If one person has put several likes, and then deleted 1 of them, it does not show which one was deleted.
When callbacks with reactions appear in groups, variables are available in the block:
reaction_on_message_id - contains the ID of the message that was responded to
reaction_from - id from whom there was a reaction
message_from_username - username from whom there was a reaction (if any)
reaction_from_name - name from whom was the reaction
Also, if Telegram responds to a message, the reply_text variable in the card will contain the full text of the message that was answered.

If a message was sent as a reply (quoting a previous message), the system will also generate the tg_quote variable, which contains the quoted text.


Callbacks with boost
chat_boost_from user #{id_user} - gave a boost to the chat (or channel):

When this callback is triggered, variables are generated:

remove_boost_from user #{id_user} - they took the boost from the chat (or channel):

When this callback is triggered,, variables are generated:

chat_boost from giveaway - issued during the drawing of stars in the channel
remove_chat_boost from giveaway - the boost period for drawing stars in the channel has ended
How to automate the removal of system notifications in groups
To automatically delete all system messages, it is enough to assign any value to the del_tg_system_messages variable (the variable can be either a project constant or a transaction variable) and give the bot permission to delete messages.
The del_tg_system_messages variable can only be used in groups. In channels, assigning any value to this variable will not lead to any result.


Administrator rights in Telegram group settings
The following types of system notifications are removed:
- The name of the group has been changed
- The group's photo has been changed
- Group photo deleted
- The message is pinned
- The user joined the group
- The user has left the group
If you want to delete only selected types of system notifications, then instead of the del_tg_system_messages variable, create the del_tg_chosen_messages variable and put in it an array with the types of notifications to be deleted, separated by commas.
Please note!
These variables will only work for Telegram groups, but not for channels.
System notification options:
'new_chat_member' – the user joined the group,
'left_chat_member' – the user left the group,
'pinned_message' – the message is pinned,
'delete_chat_photo' – group photo deleted,
'new_chat_photo' –the group's photo has been changed,
'new_chat_title' – the name of the group has been changed
For example, you need to delete all kinds of system messages except joining a group; then you need to add all kinds of callbacks to the project variable (constant) except "new_chat_member".

Forum in Telegram
A forum is a group where you can create separate topics for discussion. You can use standard functions in the forum: attach media files, post polls, and set up notifications. You can also pin messages and add individual bots to each chat.

The primary purpose of a forum is to structure communication within a large community.
In a standard group chat with many participants, following conversations and finding relevant messages becomes difficult. Forums solve this by organizing discussions into dedicated, thematic threads. This automatically segments the community by topic and interest, making communication more focused and manageable.
Only the group owner can create a topic if there are more than 100 members in the group. If the group is linked to a channel, then you will not be able to create a theme. Topics are enabled in the Group settings:

As an administrator, you can create a topic in the settings of the forum group:

After connecting the Topics, the avatar will change from round to square, which allows you to distinguish the forum from other Telegram chats:

How to configure a Telegram-client bundle with a website?
Read more about how to link a telegram client and a client from the website after a successful payment here.
Last updated