Telegram bot in Python for partner support and selling services from Avivi

9 September 2024

next article
Slava Nahnybida

PR manager

Slava Nahnybida
Telegram bot in Python for partner support and selling services from Avivi

Telegram bots are conquering an increasingly large segment of the IT structure of companies and for good reason: it is simple, convenient and extremely effective. The Avivi company specializes in the development of custom bots and knows from its own experience what benefits they bring to their owners. One of the orders for our company was the development of a bot to support customers of a food company. A simple, at first glance, solution hides a rather interesting challenge, namely the integration into the product catalog project. Now we will tell you in detail what problem Avivi specialists solved and how our solution can be useful directly for you.

The purpose of creating a bot

A product company always solves the main issues of interaction with customers, which involve several consecutive steps:

  • Identify the client — find out who exactly is applying, whether it is a new or an existing client;

  • Creation of an offer — providing the user with the opportunity to choose a product or service from the list of available ones, the possibility of customizing the order with additional items, for example, choosing a tariff plan or ordering several items at once;

  • Order payment is a key task that brings profit to the company;

  • Saving the history of interaction for further cooperation.

Quite often, client support is added to the list of these tasks, that is, the possibility of direct communication with company representatives in case of difficulties. However, this is not a mandatory option, and in our case, its implementation was not part of the project's terms of reference.

A standard solution in IT, which is the key to solving all of the above, is user authorization in a personal account. The client gets his own virtual space where he can view personal information, money balance, order history and much more. This is the kind of functionality that we put into the new Telegram bot, as the main one. But a special question remained, how to provide users with the ability to create orders.

Catalogue

A trade catalog is commonplace for any online trade. This is a special database that stores information on all possible options for offers from the company. Products from the catalog are delivered to the user, who can select them, add them to the cart and delete unnecessary ones and, finally, form the final purchase order.

Creating a product catalog for web solutions is a common thing, but in the case of the Telegram bot, we have certain features that are worth mentioning. Avivi's Telegram bot is deployed on the customer's server, where Docker is preinstalled. This tool for managing isolated Linux containers is one of the best solutions for building telegram bots for several reasons:

  • All functionality of the solution is divided into separate categories and distributed among separate containers, which improves the structure of the application;

  • Isolated parts increase the level of safety of the entire project;

  • It is possible to distribute the load, and therefore improve the speed of the solution;

  • Each container can be updated separately without affecting the overall operation of the bot.

In our case, the catalog is a separate database in a separate container, which can be accessed through the entire bot management dashboard. For the company's employees, this is not of particular importance, because all possible tools are already collected here. However, from an architectural point of view, this approach allows you to freely edit the directory without fear of breaking the solution.

Features of the user interface

From technical issues, we move on to a practical application, which also has a set of features. The main one is communication with the client in the mode of one message. For a better understanding, it looks like this: the bot automatically deletes the previous message and displays the next one in Telegram. This approach facilitates interaction with the bot, when the history of communication is not accumulated by a long chain of unnecessary information.

At the beginning of working with the bot, after authorization, the user gets to a simple menu where there are only basic options: view general information about the bot and the privacy policy, go to the catalog or personal account.

Each subsequent message from the bot, in addition to the relevant information, contains a footer - the lower area of the window where the navigation buttons are attached. This makes it easier to work with the bot and intuitively tells users the sequence of possible actions.

The catalog is displayed as a list of categories and dynamic substitution of subcategories: the client clicks on the desired button, after which a list of lower-level categories appears. This can go on forever. At the lowest level, a thematic image of the product, description, price and the "Buy" button appear in front of the client. We implemented the most simple functionality, which makes using the bot easy and understandable.

Personal office

In the personal account, the authorized user can view the main data:

  • Current account balance;

  • Number of referrals;

  • The amount of earnings.

Also, a unique referral link is placed here, which is necessary for building an affiliate system and attracting new users. The list of buttons in the personal account includes order history, bot language selection, balance replenishment, replenishment check, and a withdrawal request button.

Replenishment of cryptocurrency balance is possible from such exchanges as: Bybit, Galxe, Kukoin, Bitget, Backpack, Binance, Bitmart, Okx, Bingx, Mexc, Gate.io, Sandbox, Hashkey and Whitebit. Integration with any other exchange that has open APIs is possible, and the average development time is 50 hours of programmer work.

Information for customers

The bot from Avivi provides users with the most comprehensive information about the terms of service and partnership. Most of the important texts are displayed by the standard means of Telegram: press the button and receive a message from the bot. However, it is impossible to do this for the "Terms of Service" section, so for this point, Avivi developers created a WebAPP for Telegram. This approach made it possible to fit an almost unlimited amount of information in the form of formatted text into the interface.

Summary and conclusions

Avivi developers have created an effective Telegram bot capable of meeting the needs of a grocery company's customers in purchasing goods, managing money, and monitoring network structure. The solution is created in the Python programming language, the capabilities of the Django framework are used for the dashboard, which makes administration simple and convenient for company employees. Each component of the project is placed in a separate container based on Docker, which makes the solution fast, reliable and secure. An important component is the trade catalog, which allows you to offer customers the entire range of products. Interaction with the bot takes place within one message from the Telegram bot. Replenishment of the account or withdrawal of earnings is possible using as many as ten crypto exchanges.

Although most companies operate under similar scenarios, each business is unique, so any finished product requires customization specifically for the customer's needs. We at Avivi have already spent over 150 hours to develop a scale-ready framework. So now there is very little left to make our solution as convenient as possible for you. Do not delay and contact Avivi for comprehensive information and estimate of the cost of work just for your bot!

Baner articles 2024 telegram.png


Similar articles
Apply for a consultation

We will reach out to within 10 minutes