Abstract on the Topic of the Graduation Project
Content
- INTRODUCTION
- 1 ANALYSIS OF SOFTWARE TOOLS FOR CREATING TELEGRAM CHAT BOTS
- 2 ANALYSIS OF THE CAPABILITIES OF TELEGRAM CHAT BOTS
- 2.1 Description of functions, capabilities, limitations, and usage scenarios of Telegram chat bots
- 2.2 Comparative analysis of the capabilities provided by the Bot API and the Telegram API for managing chat bots
- 3 ANALYSIS OF READY-MADE TOOLS FOR MANAGING CHAT BOTS
- 3.1 Software solutions for working with the Bot API, their disadvantages
- 3.2 Cloud solutions for managing chat bots
- CONCLUSIONS
- REFERENCES
Introduction
In the modern world, web applications occupy an incredibly large niche, performing a wide variety of tasks. Telegram bots, due to their capabilities and ease of use, can be competitive. In this material, we will analyze the capabilities of Telegram bots, as well as the tools for creating them.
1 ANALYSIS OF SOFTWARE TOOLS FOR CREATING TELEGRAM CHAT BOTS
A chatbot is a program designed to simulate human conversation, or in other words, a conversational program. The first chatbots were created as experiments starting in the 1960s. For example, the program Eliza, created in 1966, can be considered one of the first chatbots. It was programmed to act as a psychotherapist, mainly using the technique of active listening by asking additional questions based on the user's previous message. Naturally, it was far from being a real human, but still, it might have taken some people a considerable amount of time to realize that they were communicating with a computer.
Chatbots of that era can be characterized as primarily experimental. A significant change occurred at the turn of the twentieth century when the source code of the program Alice became publicly available, allowing third-party developers to thoroughly investigate its operating principles. This led to the creation of the bot SmarterChild, which was used in Microsoft's MSN and AOL chats. Chatbots found their application as virtual assistants, such as Apple's Siri or Amazon's Alexa.
![]() |
Figure 1 — Eliza`s chatbot UI. |
In 2016, there was a milestone integration of chatbots into the messenger of the social network Facebook. Third-party developers were given the opportunity to create accounts marked as bots without fearing being blocked by the system. Previously, a chatbot could be integrated independently, for example, by managing a personal or separately created account in the messenger. However, in most user agreements, it was strictly prohibited to use third-party programs that simulate human communication. This development opened up new horizons for the application of chatbots.
Most modern messengers have special bot accounts designed specifically to be managed by computer programs, not by humans. Among them are WhatsApp, Telegram, the domestic VKontakte, and many others. A bot account has a number of restrictions and a special marker to ensure users do not mistake it for a real person. Additionally, such accounts often have enhanced capabilities compared to a regular user account. For example, they can create buttons in the dialogue for more convenient use by the chatbot's users.
2 ANALYSIS OF THE CAPABILITIES OF TELEGRAM CHAT BOTS
Telegram is a rapidly developing free messenger created by Pavel Durov, the founder of VKontakte. In promotional materials, it often emphasizes its unique security features, comparable to P2P solutions, although this claim is frequently questioned online. Nonetheless, the messenger's functionality has attracted many people and spurred rapid growth in popularity. Particularly, as of August 2023, the messenger's audience in Russia reportedly exceeded 75 million users. According to statements by Pavel Durov in his personal Telegram channel, the total audience amounts to 800 million users.
The messenger offers a wide range of functionalities: chat communication, calls using internet connection, file and media sharing, the ability to create groups and channels, and most importantly, the ability to create a special bot account that can be managed via an API.
It's important to mention that Telegram also provides an API for managing a standard user account, which is necessary for creating third-party client applications and also enables the creation of chatbots[9]. However, using this method is more complex and less convenient compared to the specialized API for bot accounts (hereinafter referred to as Bot API). Additionally, some bot functions will not be available when using this approach. More details on this will be discussed later in the section comparing the API and Bot API.
2.1 Description of Functions, Capabilities, Limitations, and Usage Scenarios of Telegram Chat Bots
Let's delve into the capabilities provided to bot accounts by the messenger. The primary function of a Telegram bot is receiving and sending messages in a dialogue with users. The bot can use Markdown and HTML for formatting the messages it sends. This functionality, combined with the ability to use a large array of emojis, allows for highly flexible text formatting, avoiding monotonous messages. Additionally, a keyboard can be attached to the message, which simplifies interaction with the bot. The ability to send and receive files or media documents is also fully functional in dialogues with the bot.
One of the competitive advantages of bots in Telegram is the integrated payment system, which can be used directly in the dialogue with the bot. This allows users to securely pay for services, providing their payment details only to the system and not to the bot owner[10].
A bot can be a member of a channel or group. In such cases, if it has the necessary permissions, it can help maintain order, block users, and automatically publish posts at designated times.
Another interesting capability of a bot account is the Inline mode – a mode in which the use of the bot is not limited to a single dialogue, group, or channel[8]. Any user who has previously added the bot can access it in any of their chats, make a request directly in the text input window, and receive a result that can, for example, be immediately sent in the current dialogue..
A recent innovation by Telegram demonstrates its desire to develop bots as mini-applications, personal assistants with extended capabilities, and a wide range of application scenarios. This transforms the messenger into a super-app, similar to China's WeChat. Specifically, in the Bot API 6.7 update from April 21, 2023, full integration of web applications directly into the messenger interface was introduced. Now, a bot can provide users the option to launch one or more embedded applications, written using HTML and JS. In other words, these are full-fledged websites, with all the ensuing implications. The messenger application sends requests directly to the developer's server, revealing the IP address of the bot user. Previously, all interactions using a Telegram bot occurred via the API. Nevertheless, the ability to open external sites allows for the integration of any functionality that can be implemented within web applications.
All these capabilities allow for the implementation of a wide variety of bot usage scenarios. A Telegram bot can no longer be considered just a virtual conversational partner; it's an extended user interface with a whole set of unique functions and features, offering certain advantages over standard applications.
The most significant of these advantages is simplicity, which is evident in several aspects, both technical and even psychological. This is not about the capabilities of the bot, which could be limited in functionality, but rather about the user and developer experience.
On one hand, anyone can access the desired bot simply through a link, avoiding the need for installations and remaining in a relatively safe environment, thereby gaining full access to all its functions. They can even make purchases without fearing for their payment data. This enables the creation of assistant bots designed to process simple requests, such as a translator or a code converter into formatted images. Bots can assist owners of groups and channels, introducing automated moderation and post publication. Alternatively, one can create a full-fledged web application equivalent directly within a bot, without resorting to standard web technologies. Examples include a sushi shop or even an online bank.
On the other hand, developers require considerably less effort to create their own "bot-application". For instance, to receive incoming messages, one can use long-polling – a method of communication with the server where the client sends a request to the server, which in turn closes the connection only when the necessary data is available, in our case, incoming messages, or after a certain time period. The client simply opens a connection with the server and waits for the server to close it with the necessary data. This method allows for the prompt reception of fresh data, such as new incoming messages in the bot, without even opening ports on the server. This approach does not significantly compromise the speed of receiving fresh data from the server. Such a method is very convenient for small and simple bots, allowing to skip standard steps in setting up a web server and is, to some extent, safer than conventional web applications.
Additionally, developers don't need to program complex interfaces, create designs, or debug the bot for different browsers. They can replace all this with simple text messages and a few buttons to enhance user experience. Developers don't have to worry about user authorization and registration systems, as the messenger takes care of all these tasks. This saves a significant amount of time, and in commercial projects, it also saves resources.
Moreover, there is always the possibility to integrate a full-fledged web application with absolutely any functionality available to standard web applications, up to physical simulations.
The combination of all these features opens up broad possibilities for integrating bots in work, daily life, or entertainment. Let's provide examples of some bots for illustration:
- Eddy Travels (@EddyTravels_bot) – Assists users in searching for flights, hotels, and restaurants, utilizing data from Skyscanner.
- Skeddy (@SkeddyBot) – A tool for creating reminders that users can interact with in conversational style.
- Combot (@combot) – Helps turn your group into a fully-fledged community by handling moderation tasks, analytics, spam fighting, and providing a trigger system.
- File to Bot (@filetobot) – Allows storing files in the cloud with unlimited storage in Telegram.
- Gmail bot (@gmailbot) – Enables users to receive, send, and reply to emails directly within the Telegram interface.
- Ultimate Pollbot (@ultimate_pollbot) – Offers advanced features for creating various polls with single or multiple voting, anonymous or public votes, as well as managing multiple polls and conveniently viewing their results.
- Feed-reading bot (@TheFeedReaderBot) – elps users stay updated with the latest news on their topics of interest by sending notifications about posts and articles from various sources like blogs, YouTube, Facebook, and Instagram.
- Transcriber bot (@transcriber_bot) – Capable of transcribing audio recordings and images into text, supporting more than 20 popular languages.
- YouTube search bot (@vid) – Allows users to search for and share YouTube links directly within the Telegram app.
- Áëàíê (@BlancMoneyBot) – A business management bot, enabling the opening of individual entrepreneurship or LLC and accessing personal cabinet functions.
I would like to specifically highlight Telegram bots developed and actively used in Donetsk:
- "My Phoenix" (@myphoenix_bot) – This bot replaces the application for managing accounts with the internet provider and communication operator "Phoenix."
- "HappyLife" (@HappyLifeOrderBot) – A bot for placing orders at the HappyLife restaurant chain.
2.2 Comparative Analysis of the Capabilities Provided by API and Bot API for Managing Chat Bots
Let's start with the standard Telegram API. It is open and completely free, and developers claim it is essential for creating custom Telegram clients. A key feature is the MTProto protocol – Telegram's proprietary development specifically for messenger operations. Access to the API is made through this protocol. While a detailed examination of the protocol is not necessary, it is important to note that working with the API through MTProto is more complex than simply interacting with an HTTP API.
This interface provides all possible functions for managing regular user accounts, allowing the creation of so-called user-bots. However, within the scope of this material, the discussion of user-bots will be omitted.
In addition to managing regular user accounts, it is also possible to manage the bot-accounts that are of interest to us. More on their features will be discussed next.
The Bot API[6] is an overlay on the standard Telegram API, designed to simplify API interaction for bot developers. The Bot API is a standard HTTP API and supports both WebHooks and Long Polling. To authorize in the Bot API, you only need to have a unique secret token obtained when creating the bot. Essentially, it acts as an intermediary between our program and the standard Telegram API.
![]() |
Figure 2 — Interactions with the telegram bot (Animation: 6 frames, duration 7 seconds, no limitation of repetition cycles, 15 kb) |
A single Bot API server services a large number of bots, which imposes certain limitations, such as the size of uploaded files and message limits. The company has published the source code of the Bot API server and allowed the deployment of local copies. This enables overcoming the file size limitations for the Bot API.
It's important to mention the limits imposed on bots. According to the documentation, it's inadvisable to send more than one message per second to a user, or more than 30 messages per second in total. These limits are approximate and not a strict constraint. They can be exceeded for a short time without affecting the bot's operation. However, consistently exceeding these limits will lead to interruptions from the Bot API: updates may not reach the bot, or an error may be returned in response to a request. These limits can be increased for larger bots through technical support, according to statements from owners of Telegram bots with large audiences. Alternatively, the impact of these limits can be partially mitigated by setting up a local Bot API server exclusively for your bot. Unfortunately, exact figures were not available.
3 ANALYSIS OF READY-MADE TOOLS FOR MANAGING CHAT BOTS
3.1 Software Solutions for Working with Bot API and their disadvantages
Developers of the Bot API provided only an HTTP API. Implementations of clients were created by third-party developers:
- https://github.com/eternnoir/pyTelegramBotAPI – Python;
- https://github.com/yagop/node-telegram-bot-api – NodeJs;
- https://github.com/pengrad/java-telegram-bot-api – Java;
- https://github.com/reo7sp/tgbot-cpp – C++;
- https://github.com/TelegramBots/Telegram.Bot – C#;
- And many other solutions. Telegram developers showcase some of them on their website: https://core.telegram.org/bots/samples.
The list includes simple client libraries for the HTTP API without additional functionality. More advanced tools will be discussed in one of the following sections. These clients are supported by the community, and some may not keep up with changes in the Bot API or may stop receiving updates altogether. Therefore, it is important to pay attention to the size of the community, update frequency, and the availability of documentation when choosing a solution.
The provided solutions allow you to fully utilize the features of the Bot API, including WebHooks or Long Polling. However, it's worth noting that the use of these tools may not fully satisfy the community's needs. Based on the experience of the author of this material and messages from bot developers on the internet, the following conclusions can be drawn: For developing a simple assistant bot with minimal functions mentioned earlier, the mentioned libraries are sufficient. However, considering the specific features and limitations of the Bot API, more complex solutions are required to create fully-fledged replacements for web applications within the Telegram messenger environment. For example, often, the implementation of a finite state machine is needed for sequential interaction with users.
Therefore, the community of bot developers is not standing still and continues to offer new, improved tools to address more complex tasks:
- https://github.com/aiogram/aiogram – Python
- https://github.com/MajMcCloud/TelegramBotFramework – C#
- https://github.com/RxTelegram/RxTelegram.Bot – C#
- https://github.com/teloxide/teloxide – Rust
- https://github.com/telegraf/telegraf – NodeJs
This list features some of the most popular and interesting tools within the research material, according to the author's perspective. These solutions provide additional features to developers, such as asynchronicity, finite state machine implementation, and more. In the library descriptions, they are presented as frameworks—a ready-made set of tools that help developers quickly create a product, in this case, a bot.
3.2 Cloud solutions for managing chat bots
There are many cloud services available on the internet that assist in creating and managing Telegram bots. Often, they are aimed at individuals who are not familiar with programming and offer No Code development options. These services may impose additional restrictions and limits. Frequently, they only allow the creation of bots for pre-defined usage scenarios.
If a developer wishes to utilize the full functionality of bots and have complete control over them without constraints, it is advisable to use their own software solutions. Therefore, within the scope of this material, such services will not be discussed.
Conclusions
Telegram chatbots are powerful tools capable of replacing user interfaces for both simple and complex applications within the messaging platform.
Telegram developers provide opportunities but not ready-made solutions and tools for creating Telegram bots. This role is delegated to the community of bot developers. Undoubtedly, this community is smaller than the community of web developers, which affects the quantity and quality of third-party tools. However, developers continue to advance this field, enhancing both user experience and development capabilities.
List of References
- ELIZA – A Computer Program For the Study of Natural Language Communication Between Man and Machine [Ýëåêòðîííûé ðåñóðñ]. – Ðåæèì äîñòóïà: http://universelle-automation.de/1966_Boston.pdf
- ALICE chatbot: Trials and outputs [Ýëåêòðîííûé ðåñóðñ]. – Ðåæèì äîñòóïà: https://www.researchgate.net/publication/289684788_ALICE_chatbot_Trials_and_outputs
- ×àò-áîòû: ýâîëþöèÿ è èñòîðèÿ [Ýëåêòðîííûé ðåñóðñ]. – Ðåæèì äîñòóïà: https://botcreators.ru/blog/chernovik-chat-boty/#:~:text=SmarterChild%20áûë%20÷àò-áîòîì%2C%20ñîçäàííûì%20AOL,ïðîäóêòîâ%20AOL%20çà%20âñþ%20èñòîðèþ
- Wechat èëè äåéñòâèòåëüíî âñåîáúåìëþùåå ïðèëîæåíèå. ×òî ñ íèì ìîæåò äåëàòü ðàçðàáîò÷èê [Ýëåêòðîííûé ðåñóðñ]. – Ðåæèì äîñòóïà: https://habr.com/ru/articles/492420/
- MTProto Mobile Protocol [Ýëåêòðîííûé ðåñóðñ]. – Ðåæèì äîñòóïà: https://core.telegram.org/mtproto
- Telegram Bot API [Ýëåêòðîííûé ðåñóðñ]. – Ðåæèì äîñòóïà: https://core.telegram.org/bots/api
- Telegram Mini Apps [Ýëåêòðîííûé ðåñóðñ]. – Ðåæèì äîñòóïà: https://core.telegram.org/bots/webapps
- Inline Bots [Ýëåêòðîííûé ðåñóðñ]. – Ðåæèì äîñòóïà: https://core.telegram.org/bots/inline
- Telegram API [Ýëåêòðîííûé ðåñóðñ]. – Ðåæèì äîñòóïà: https://core.telegram.org/methods
- Êîðîòêî ïðî ïëàòåæè ÷åðåç áîòîâ â Telegram [Ýëåêòðîííûé ðåñóðñ]. – Ðåæèì äîñòóïà: https://habr.com/ru/companies/otus/articles/781194/