Answer the question
In order to leave comments, you need to log in
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
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.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question