A
A
aial2017-01-20 13:25:46
Python
aial, 2017-01-20 13:25:46

How to make a Telegram bot for consultation via Python?

How to make a Telegram bot for consultation via Python, I want that if you click on the consultation button with a specialist, the bot will send the question that the user asked to the specialist, and he will start a conversation on behalf of the bot.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilyas, 2017-01-20
@aial

oooh, I made such a bot, I used this library , the
logic is this:
1. the client writes to the bot, while we get a chat id with the client;
2. send this message from the bot to all operators and add to the message a link to a command like /chat_xxxxxxx;
3. when calling this command by an operator, I create a dictionary, where the entries in the dictionary are the numbers of chats with operators, and the values ​​of the entries are the number of the client's chat, as a result we get a bunch of client-operator chats;
4. when sending a message by the operator after completing step 2, the message is sent to the client on behalf of the bot and is also duplicated to all operators so that the answers are not duplicated
if there are questions - write

N
nllm, 2017-01-20
@nllm

The consultant also subscribes to the bot. In scripts (configs, database) you indicate that the user with id such and such is a consultant.
When you click the "consultant" button, all messages from the user are sent to the consultant.
It will only be a problem if several dialogues go on at once. The consultant will be confused.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question