D
D
dimashapoval2020-11-18 00:24:58
Telegram
dimashapoval, 2020-11-18 00:24:58

How can a pyrogram user bot read and output the text of the next message to the console?

The essence is that it is necessary that the bot send a message to the chat,
then read the text of the next message and output it to the console

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artur Boyun, 2020-11-18
@arturboyun

You need to take the chat id, for example using the same @ShowJsonBot
Then write a small script that will send a message to this id when it starts.
And listen to the message something like this:

@app.on_message()
async def hello(client, message):
    print(message.text) # Выводим в консоль
    sys.exit() # Завершаем работу скрипта

I advise you to read the lib: https://docs.pyrogram.org/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question