How are messages updated

ShowMode

Currently, to manage the update of the dialog, we use the feature called ShowMode.

When we need to change show mode we can just use show_mode setter on DialogManager or pass it in DialogManager methods (.start, .update, .switch_to, etc.)

async def open_next_window(event, widget, manager: DialogManager):
    manager.show_mode = ShowMode.SEND
    await manager.next()


async def switch_to_another_window(event, widget, manager: DialogManager):
    await manager.switch_to(
        state=SomeStatesSG.SomeState,
        show_mode=ShowMode.SEND,
    )

Important

ShowMode changes only for the next update and then returns to AUTO mode.

class aiogram_dialog.api.entities.modes.ShowMode(Enum)

Modes of show dialog message when new update handled.

AUTO:

default show mode.

Uses SEND mode when new message from user handled or EDIT mode when any other updated handled.

EDIT:

edit dialog message

SEND:

send new dialog message

DELETE_AND_SEND:

delete and send new dialog message

Attention: Telegram’s restrictions will prevent the deletion of the message when more than 2 days has elapsed.

NO_UPDATE:

will not update and rerender the dialog message