Tishka17 / aiogram_dialog

GUI framework on top of aiogram
https://aiogram-dialog.readthedocs.io
Apache License 2.0
671 stars 103 forks source link

ShowMode in manager.start() doesn't work as expected by some users #358

Closed KOT4N closed 7 months ago

KOT4N commented 8 months ago

MRE: https://github.com/Tishka17/aiogram_dialog/blob/develop/example/input_media_group.py

If you set ShowMode.EDIT in start() - message don't be edited:

async def start(message: Message, dialog_manager: DialogManager):
    await dialog_manager.start(Medias.start, mode=StartMode.RESET_STACK, show_mode=ShowMode.EDIT)

If you set show mode by dialog_manager.show_mode = ShowMode.EDIT - message will be edited:

async def on_input_photo(message: Message, widget: MessageInput,
                         dialog_manager: DialogManager):
    dialog_manager.show_mode = ShowMode.EDIT
    dialog_manager.dialog_data.setdefault("photos", []).append(
        (message.photo[-1].file_id, message.photo[-1].file_unique_id),
    )
KOT4N commented 8 months ago

note: now i know that showmode works only on request.

Tishka17 commented 8 months ago

We need to clarify this behavior in documentation: all show modes apply only for single update