D
D
dimashapoval2021-07-19 00:48:59
Python
dimashapoval, 2021-07-19 00:48:59

How to get the value of the next aiogram message into a variable?

The bottom line is that a person clicks on a button, the bot asks him to enter something, how to get this "something" into a variable

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
SKEPTIC, 2021-07-19
@pro100chel

If it's quite simple.
After pressing the button, you throw the user id into a special list, the presence in which means that the next message should be written to a variable.
At the next message, you check the user's id for existence in that list. If it is there, then you write the message to the variable and do whatever you want with it and delete the user id from the list.
This is the easiest thing to do. There is no need to use third-party storage and implement / use a state machine.

S
soremix, 2021-07-19
@SoreMix

https://github.com/aiogram/aiogram/blob/dev-2.x/ex...

M
Mikhail Krostelev, 2021-07-19
@twistfire92

You need this manual

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question