SwitchTo#
SwitchTo represents the button, on the click switches to the definite window in the same dialog.
from aiogram_dialog.widgets.kbd import Button
async def on_click(
cq: CallbackQuery,
button: Button,
dialog_manager: DialogManager
):
... # your actions
await dialog_manager.switch_to(SOME_STATE)
button = Button(..., on_click=on_click)
Equal:
from aiogram_dialog.widgets.kbd import Button, SwitchTo
async def on_click(
cq: CallbackQuery,
button: Button,
dialog_manager: DialogManager
):
... # your actions
button = SwitchTo(..., state=SOME_STATE, on_click=on_click)
More: Transitions