Не работает кнопка назад, машина состояний обновляется, но хендлеры заново не вызываются. Подскажите, как можно исправить
@dp.callback_query_handler(state="*", text="Назад")
async def back(call: CallbackQuery, state: FSMContext):
await Application.previous()
@dp.message_handler(Command("start"))
async def show_greeting(message: Message):
text = message.from_user.first_name + "," + open("texts/ru/Приветствие.txt", "r").read()
await message.answer(text, reply_markup=choice_target)
await Application.target.set()
@dp.callback_query_handler(state=Application.target)
async def choice(call: CallbackQuery, state: FSMContext):
text = call.from_user.first_name + "," + open("texts/ru/Недвижимость.txt", "r").read()
await call.message.edit_text(text, reply_markup=choice_country)
async with state.proxy() as data:
data['target'] = call.data
await Application.country.set()
@dp.callback_query_handler(state=Application.country)
async def choice(call: CallbackQuery, state: FSMContext):
text = call.from_user.first_name + "," + open("texts/ru/Турция.txt", "r").read()
await call.message.edit_text(text, reply_markup=choice_time)
async with state.proxy() as data:
data['country'] = call.data
await Application.visitPlan.set()
@dp.callback_query_handler(state=Application.visitPlan)
async def choice(call: CallbackQuery, state: FSMContext):
text = call.from_user.first_name + "," + open("texts/ru/Варианты оплаты.txt", "r").read()
await call.message.edit_text(text, reply_markup=choice_form_deal)
async with state.proxy() as data:
data["visitPlan"] = call.data
await state.finish()
Источник: Stack Overflow на русском