Skip to content

I can't use TextInput along with processing messages in aiogram. #461

@elter-tef

Description

@elter-tef

I have a dialog with a window that has a TextInput

Window(
        Format("{step_question}"),
        TextInput(id="step_answer", on_success=step_question_text_handler),
        Cancel(),
        state=CreateFormSG.question_step,
        getter=step_question_getter,

and also has the processing of all text messages in aiogram

@dp.message(F.text)
async def start(tg_message: types.Message, dialog_manager: DialogManager, db_session: AsyncSession, db_user: User, state: FSMContext):
    print(await state.get_state())
    print('aiogram text handler')

Expected behavior: When using the dialog, messages will end up in step_question_text_handler ( as i think because state==CreateFormSG.question_step ).

Current behavior: When using the dialog, messages end up in all messages handler with state==None

None
aiogram text handler

Is this a bug or am I doing something wrong?

Name: aiogram_dialog
Version: 2.3.0

Name: aiogram
Version: 3.17.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions