A
A
Askarov pro2018-05-28 14:02:05
Python
Askarov pro, 2018-05-28 14:02:05

How to talk to a user through a Telegram bot?

@bot.message_handler(context_types=["text"])
def send(message):
     bot.forward_message(595176747,from_user.id, message_id)

How to transfer the entered message to another Telegram user?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Sokolov, 2018-05-28
@sergiks

The user should initiate the conversation: write to the bot first. The incoming message will contain chat.id and user.id parameters - chat and user identifiers.
To send a message in response immediately or later, you need to remember at least chat.id
If you are using some kind of ready-made bot, a link to its github will not hurt.

U
Uno, 2018-05-28
@Noizefan

It is necessary to implement user roles, and when the client writes, send the message to the conditional operator. Same with the operator. It is difficult in words, but if the separation of rights among users was done on web projects, you can handle it calmly)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question