Today, Telegram is among some of the most popular messaging apps, and it is used by nearly a billion people around the globe for both personal and professional communication. The app's rich features and constantly growing audience make it an attractive choice of customer communication tool for brands. Many companies have Telegram channels where they share content and process incoming customer support inquiries via their Telegram account. In this guide, we will show you how to set up a chatbot in Telegram with Umnico chatbot builder to effectively automate your customer communication.
Using chatbots in Telegram offers many advantages for companies, making communication with users more efficient and convenient:
It is important to clarify that if we are talking about creating a bot inside Telegram, then yes, creating such a bot is free. Telegram provides an option to create a bot through BotFather, a special bot in Telegram that manages the creation and customization of other bots. After creating a bot through BotFather, the user receives an access token that is used to interact with the Telegram API. We'll talk more about this later.
If we talk about integrating a bot in Telegram into a chatbot with AI, it is necessary to buy a subscription to one of the available services, such as Umnico chatbot builder.
Let's create our own chatbot for Telegram in the Umnico chatbot builder. Anyone can cope with the task — no programming skills are required.
You can also check out the video instructions for Telegram chatbot connection and setup.
In your Umnico personal account, go to “Settings”, then select “Integrations - Telegram Bot”.
The connection window opens.
Go to the Telegram app and use the search function. Type “@BotFather”, and after making sure it's an official bot (it will be indicated by a white check mark in a blue asterisk), select it.
Enter the command “/newbot” and come up with a name for the bot. BotFather will check if the name is available and suggest adding the suffix “_bot” (e.g. Bot_Umnico_telegram_bot). Once confirmed, you will receive an API token to connect. Copy it and return to Umnico.
Paste the API token into the corresponding field in Umnico and click “Connect Telegram”.
After that, the Telegram integration will appear in the “Connected” section.
To set up bot scenarios in Telegram using the Umnico chatbot builder, you need to create a chatbot project. To do this, follow the steps below.
Go to the “Chatbots” section in the left menu of the platform. Click on the “Create project” button to start the process of creating a new bot.
In the settings of the created chatbot, select Telegram as the platform for sending messages. To do this, click on the “Settings button to access additional settings.
Go to the “Messengers” tab and select the previously configured Telegram integration.
Click the “Refresh” button to save the connection settings.
After creating a project, the chatbot builder opens, which is a visual flowchart. Here you can create chains of messages to interact with users by adding blocks with text, conditions, triggers, and actions.
To add a new step linked to a previous step, click on the “+” sign next to the last step and drag it to the desired location.
To add an unlinked step, use the right mouse button and select “Add Step”. Double-click on the step to give it a name.
To change the route of an arrow, select it and drag the end to the new step. Delete an arrow by selecting it and pressing the Delete key. Double-click the arrow to focus on the destination step.
When you move to a new step, the target steps are completed first, then you move to the next step. When all steps have been completed, the scenario ends.
To set the transition pause between steps, highlight the desired step and change the time in the appropriate settings field.
Each step can contain several actions performed in sequence. Add actions via the “Add block” button and change their order by dragging and dropping them. Move actions between different steps as needed.
The scenario conditions are organized into blocks. Each block may include one or more conditions, which are connected by a logical “AND”, and the blocks themselves by a logical “OR”.
This is what two blocks with one condition in each look like:
In the first example, the condition will be true if the current time does not fall between 8:00 and 18:00.
And here, if time is within the set period.
To fulfill a condition, at least one block must be true, and within a block, all conditions must be met.
To add the first condition, press “+”. To add a condition to an existing block use the “AND” button, to create a new block use the “OR” button.
Conditions include:
Each variable has its type, on which the available list of operators and operand type depends.
Any condition can be inverted by setting the “NOT” flag in the settings. This reverses the value of the condition.
Event blocks are activated when certain actions occur (indicated in blue or yellow). The script waits for the event and proceeds to the corresponding block or next step after a timeout (24 hours by default).
Unlike conditions, which are checked once a step transitions, events are checked while waiting on a step.
Most events process all waiting scenarios.
Blue events (incoming messages) are processed one by one: the scenario that sent the last message or the one created earlier has priority.
If no scenario has processed the message, it is passed to the global branch.
Adding a wait block to the steps allows you to customize the response to specific user actions. For example, to wait for the word “yes” to be entered, add a “Full match” block and specify the required phrase. The step will wait for the “Message from Customer” event to occur that meets the specified conditions.
Several expected events can be set on one step -- triggering of any of them will continue the scenario.
The event is activated if the scenario is on the corresponding step.
The default timeout for waiting is “24 hours”. To set an individual timeout, you will need to change it in the step settings.
Events can be renamed and moved by double-clicking and dragging with the mouse, respectively.
Buttons in a chatbot allow the user to quickly move to the next step of the script without typing a text response.
To attach a button to a message, add a corresponding block in the step with sending a message.
The regular button is displayed below the input bar, and the inline button is attached to the post.
This is what a step with a button looks like.
By attaching alternative keywords to a button, the chatbot can handle different answer choices that the button does not support. To do this, specify one or more keywords (each on a separate line or separated by a “|”).
Please note: buttons can only be added to a step with a message. When a message has conditions, if the conditions are not met, the buttons will not be sent.
The inline button is attached to the message and remains active even when the script has already moved to another step or is completed. Such buttons can return the scenario to the previous steps and even restart the completed scenario session. This is adjustable in the button settings.
Inline URL is essentially no different from regular buttons if the “URL following is captured, URL is replaced” option is activated. Otherwise, the user will receive a direct link.
Global branches allow you to start scripts by keywords and process events regardless of the current state.
If an event added to such a step occurs, a new script session is started (if it is not already running), and the script starts not from the “Start” step, but from the block event that occurred.
We recommend using no more than one global branch in a project for ease of debugging.
To test the created chatbot for Telegram, start a dialog and send a message corresponding to the scenario conditions. To access the bot in Telegram, click the link located in the upper right corner of the designer interface.
In the dialog that opens, send a unique code “restart-...” to verify the conditions and actions work, interacting with the bot as a normal user.
Following these steps, you will be able to create and customize an effective chatbot for Telegram, capable of interacting with users according to the developed scenarios.
Let's take a look at how chatbots can be useful for online stores, clinics, advertising agencies, and other industries.
Still have questions? Contact us in the “Help — Chat with operator” section of your personal account and we will be happy to help you.