Answer the question
In order to leave comments, you need to log in
3 handler not working in python bot?
I am writing a bot, I need to collect information from the user
In the first handler I get the number 1 or 2
In the second handler I write the number 1 or 2 to a variable, after receiving the information and writing it to the variable, the code cannot reach handler 3
Question why? How can this be fixed?
@dp.message_handler(commands=["start"])
async def echo(message: types.Message):
await message.answer("Выберите предмет.")
await message.answer("1 - Русский | 2 - Алгебра")
@dp.message_handler(content_types=['text'])
async def echo1(message: types.Message):
logger.info(message.text)
predmet = message.text
@dp.message_handler(content_types=['text'])
async def echo2(message: types.Message):
await message.answer("Введите номер задания.")
logger.debug(message.text)
nomer = message.text
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question