The callback function responds to pressing an inline button, but after entering any of the state.set_state blocks it does not work
@router.callback_query()
async def callback(call: CallbackQuery, state: FSMContext):
match call.data:
case 'first':
await state.set_state(Form.user)
await call.message.answer('Введите пользователя следуя инструкциям')
case 'second':
await state.set_state(Form.item_photo)
await call.message.answer('Пришлите фото')
case 'third': await call.message.answer('later')
case 'back': await call.message.answer('later')
await print(await state.get_state()) shows
await print(await state.get_state()) TypeError: NoneType object cannot be used in expect expression
I expected to see Form.user or something like that If you need handlers for these states, please let me know
You need to set state in the decorator. For example:
So in your case it's: