A
A
AstonMartin2020-03-26 09:41:53
Bots
AstonMartin, 2020-03-26 09:41:53

How to reply in chats on behalf of a telegram bot?

Good afternoon!

There is such a task. There is a company with several managers working in parallel online. There are several public telegram chats that have potential clients.
Question: how to organize communication with visitors in chats on behalf of the company's brand (including answers to customer questions)? And so that all managers have access to these dialogs.
Of course, you can register a new account and connect it to all managers as a second one, but this will not be very convenient.
How to implement this using a telegram bot?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Pankov, 2020-03-26
@trapwalker

Firstly, the telegram bot needs to know who it has who. That is, he knew the identifiers of managers and could distinguish them from users.
Secondly, the manager talks to the bot in exactly the same way as the user, but the user writes to the bot and receives the manager's responses from him, and the manager writes to the bot and receives the user's responses from him. The problem is that there are many users, and one or more bots. This is where the opportunity arises to solve this problem in different ways with its pluses and minuses.
You mentioned that you want all managers to have access to other managers' dialogues with users.
This is a problem that does not have a 100% elegant solution. Here you should describe the TK in more detail, but until it is available, I will describe only a few possibilities.
The bot can quote all dialogues to a common channel or group so that all managers can view them there. You can also reply directly to the group with a quote from the person to whom the answer is intended. The bot, having seen such a message, will forward it in its personal dialogue with the user. Quoted user responses can be tagged to filter the conversation with a specific user.
You can store all the bot's conversations with users in the database and show them to managers in their personal dialogues with the bot on a special command. You can make a command that switches the bot into the mode of direct proxying of the manager's remarks to the bot's personal conversation with a specific user.
There are many options here. Detail TK.
For you to understand, in the general simple case, a bot is a virtual user, the events around which the program reacts to. The bot can be added to a group or private chat with a person.
A bot can do almost the same thing as a normal user. Only the same program initiates these actions.
The program that controls the bot has the ability to store its state in a database or memory. So she can "know" about all the dialogues.
The program, receiving information about events around the bot, "sees" the identifiers of chats and users with whom these events are associated. May respond differently to messages in different chats and from different people.
In a difficult case, you can make not one but several instances of the program work on behalf of one bot. Then you have to connect them to a common database so that they (instances) can synchronize their state if necessary.
One program can control several bots at once. This means that bots, as it were, can "know" each other's information and states. Here you can program whatever you want.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question