V
V
Vladislav Gubarev2021-02-18 21:55:12
Python
Vladislav Gubarev, 2021-02-18 21:55:12

How to implement a user support bot in Telegram in Python?

I did not find any solutions to this issue on the Internet.
The bottom line is: the client enters the bot, selects "Contact support". Then the operator in Telegram receives a message from the bot, saying that the user needs answers. The operator enters the bot, and that's where the whole problem lies! How can an operator write on behalf of a bot? And so that messages from the user also come to the operator?

PS
The question is purely theoretical, since, as it is clear, it will not be that the operator at work will scroll through the memes in the Telegram channel and bam! he receives a message saying go to work!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Karbivnichy, 2021-02-18
@vla_doss

Check which id the message came from. If from an unknown id, in the bot redirect the message using the sendMessage method to the operator's id (in addition to the message itself, send the client's id to the operator as well). Well, let the operator respond in the format "client_id Answer". Next, the bot again checks from which id the message came. If already from the id of the operator, then, for example, we split the message from the operator into 2 parts. The first will contain the client's id, the second - the operator's response to the client. Next, we simply redirect the message itself to the client id.

I
Ignaty Shilenin, 2021-02-19
@nonadminus

On habré there is an article suitable for your request
https://habr.com/en/post/539766/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question