aiogram_dialog 2.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aiogram_dialog-2.5.0/.coveragerc +4 -0
- aiogram_dialog-2.5.0/.github/workflows/publish.yml +59 -0
- aiogram_dialog-2.5.0/.github/workflows/setup.yml +56 -0
- aiogram_dialog-2.5.0/.gitignore +6 -0
- aiogram_dialog-2.5.0/.pytest.ini +2 -0
- aiogram_dialog-2.5.0/.readthedocs.yaml +12 -0
- aiogram_dialog-2.5.0/.ruff.toml +74 -0
- aiogram_dialog-2.5.0/LICENSE +201 -0
- aiogram_dialog-2.5.0/MANIFEST.in +3 -0
- aiogram_dialog-2.5.0/Makefile +20 -0
- aiogram_dialog-2.5.0/PKG-INFO +157 -0
- aiogram_dialog-2.5.0/README.md +129 -0
- aiogram_dialog-2.5.0/docs/conf.py +54 -0
- aiogram_dialog-2.5.0/docs/faq.rst +99 -0
- aiogram_dialog-2.5.0/docs/group_business.rst +58 -0
- aiogram_dialog-2.5.0/docs/helper_tools/import.py +1 -0
- aiogram_dialog-2.5.0/docs/helper_tools/import_preview.py +1 -0
- aiogram_dialog-2.5.0/docs/helper_tools/index.rst +81 -0
- aiogram_dialog-2.5.0/docs/helper_tools/install.sh +1 -0
- aiogram_dialog-2.5.0/docs/helper_tools/preview_summary.py +34 -0
- aiogram_dialog-2.5.0/docs/helper_tools/render.py +44 -0
- aiogram_dialog-2.5.0/docs/helper_tools/render_hints.py +43 -0
- aiogram_dialog-2.5.0/docs/helper_tools/render_preview.py +1 -0
- aiogram_dialog-2.5.0/docs/helper_tools/render_preview_data.py +12 -0
- aiogram_dialog-2.5.0/docs/helper_tools/web_preview.sh +1 -0
- aiogram_dialog-2.5.0/docs/how_are_messages_updated/example.py +10 -0
- aiogram_dialog-2.5.0/docs/how_are_messages_updated/index.rst +17 -0
- aiogram_dialog-2.5.0/docs/index.rst +24 -0
- aiogram_dialog-2.5.0/docs/migration.rst +68 -0
- aiogram_dialog-2.5.0/docs/overview/index.rst +24 -0
- aiogram_dialog-2.5.0/docs/quickstart/bot.py +6 -0
- aiogram_dialog-2.5.0/docs/quickstart/dialog.py +3 -0
- aiogram_dialog-2.5.0/docs/quickstart/index.rst +51 -0
- aiogram_dialog-2.5.0/docs/quickstart/install.sh +1 -0
- aiogram_dialog-2.5.0/docs/quickstart/register.py +1 -0
- aiogram_dialog-2.5.0/docs/quickstart/setup_dialogs.py +3 -0
- aiogram_dialog-2.5.0/docs/quickstart/sg.py +4 -0
- aiogram_dialog-2.5.0/docs/quickstart/start.py +10 -0
- aiogram_dialog-2.5.0/docs/quickstart/start_bot.py +2 -0
- aiogram_dialog-2.5.0/docs/quickstart/summary.py +38 -0
- aiogram_dialog-2.5.0/docs/quickstart/window.py +16 -0
- aiogram_dialog-2.5.0/docs/resources/button.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/calendar_custom.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/calendar_days.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/calendar_months.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/calendar_years.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/case.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/checkbox_checked.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/checkbox_unchecked.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/column.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/const.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/dynamic_media.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/format.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/getter.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/group.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/group_width.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/layout_example.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/layout_example2.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/list.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/login_url.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/multiselect.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/passing_data_example.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/progress.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/quickstart.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/radio.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/render_hints.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/render_preview_result.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/render_simple.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/request_poll.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/row.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/scrolling_group1.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/scrolling_group2.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/select.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/stack_transitions.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/static_media.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/switch_inline_query_chosen_chat.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/switch_inline_query_current_chat.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/switchstate.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/toggle.gif +0 -0
- aiogram_dialog-2.5.0/docs/resources/url.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/whenable.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/whenable_extended.png +0 -0
- aiogram_dialog-2.5.0/docs/resources/window_example.png +0 -0
- aiogram_dialog-2.5.0/docs/transitions/buttons.py +33 -0
- aiogram_dialog-2.5.0/docs/transitions/done.py +46 -0
- aiogram_dialog-2.5.0/docs/transitions/index.rst +125 -0
- aiogram_dialog-2.5.0/docs/transitions/launchmode.py +4 -0
- aiogram_dialog-2.5.0/docs/transitions/start.py +41 -0
- aiogram_dialog-2.5.0/docs/transitions/startmode.py +2 -0
- aiogram_dialog-2.5.0/docs/transitions/switch.py +49 -0
- aiogram_dialog-2.5.0/docs/widgets/custom_widgets/index.rst +17 -0
- aiogram_dialog-2.5.0/docs/widgets/custom_widgets/switch_inline_query_current_chat/example.py +39 -0
- aiogram_dialog-2.5.0/docs/widgets/custom_widgets/switch_inline_query_current_chat/index.rst +10 -0
- aiogram_dialog-2.5.0/docs/widgets/hiding/example.py +41 -0
- aiogram_dialog-2.5.0/docs/widgets/hiding/index.rst +21 -0
- aiogram_dialog-2.5.0/docs/widgets/index.rst +43 -0
- aiogram_dialog-2.5.0/docs/widgets/input/index.rst +13 -0
- aiogram_dialog-2.5.0/docs/widgets/input/message_input/example.py +32 -0
- aiogram_dialog-2.5.0/docs/widgets/input/message_input/index.rst +15 -0
- aiogram_dialog-2.5.0/docs/widgets/input/text_input/example.py +63 -0
- aiogram_dialog-2.5.0/docs/widgets/input/text_input/index.rst +29 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/button/example.py +17 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/button/index.rst +17 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/calendar/custom.py +39 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/calendar/example.py +14 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/calendar/index.rst +58 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/cancel/equal_solution.py +10 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/cancel/example.py +11 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/cancel/index.rst +19 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/checkbox/example.py +17 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/checkbox/index.rst +24 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/column/example.py +8 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/column/index.rst +10 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/counter/example.py +17 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/counter/index.rst +21 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/group/example.py +10 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/group/example_width.py +11 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/group/index.rst +16 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/index.rst +59 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/list_group/example.py +60 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/list_group/index.rst +38 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/login_url/example.py +8 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/login_url/index.rst +22 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/multiselect/example.py +27 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/multiselect/index.rst +50 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/next_and_back/equal_solution.py +10 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/next_and_back/example.py +11 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/next_and_back/index.rst +21 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/radio/example.py +27 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/radio/index.rst +39 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/request_poll/example.py +13 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/request_poll/index.rst +22 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/row/example.py +22 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/row/index.rst +11 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/scrolling_group/example.py +20 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/scrolling_group/index.rst +12 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/select/example.py +37 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/select/index.rst +47 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/start/equal_solution.py +10 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/start/example.py +11 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/start/index.rst +19 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/switch_inline_query/example.py +7 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/switch_inline_query/index.rst +10 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/switch_inline_query_chosen_chat/example.py +10 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/switch_inline_query_chosen_chat/index.rst +22 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/switch_inline_query_current_chat/example.py +7 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/switch_inline_query_current_chat/index.rst +22 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/switch_to/equal_solution.py +10 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/switch_to/example.py +11 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/switch_to/index.rst +19 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/time/index.rst +22 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/toggle/example.py +31 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/toggle/index.rst +29 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/url/example.py +7 -0
- aiogram_dialog-2.5.0/docs/widgets/keyboard/url/index.rst +12 -0
- aiogram_dialog-2.5.0/docs/widgets/link_preview/example.py +27 -0
- aiogram_dialog-2.5.0/docs/widgets/link_preview/index.rst +23 -0
- aiogram_dialog-2.5.0/docs/widgets/media/dynamic_media/example.py +25 -0
- aiogram_dialog-2.5.0/docs/widgets/media/dynamic_media/index.rst +15 -0
- aiogram_dialog-2.5.0/docs/widgets/media/index.rst +15 -0
- aiogram_dialog-2.5.0/docs/widgets/media/other_media_sources/example.py +0 -0
- aiogram_dialog-2.5.0/docs/widgets/media/other_media_sources/index.rst +15 -0
- aiogram_dialog-2.5.0/docs/widgets/media/static_media/example.py +11 -0
- aiogram_dialog-2.5.0/docs/widgets/media/static_media/index.rst +26 -0
- aiogram_dialog-2.5.0/docs/widgets/passing_data/data_in_handlers.py +5 -0
- aiogram_dialog-2.5.0/docs/widgets/passing_data/example.py +54 -0
- aiogram_dialog-2.5.0/docs/widgets/passing_data/index.rst +36 -0
- aiogram_dialog-2.5.0/docs/widgets/text/case/example.py +80 -0
- aiogram_dialog-2.5.0/docs/widgets/text/case/index.rst +36 -0
- aiogram_dialog-2.5.0/docs/widgets/text/const/example.py +7 -0
- aiogram_dialog-2.5.0/docs/widgets/text/const/index.rst +14 -0
- aiogram_dialog-2.5.0/docs/widgets/text/format/example.py +36 -0
- aiogram_dialog-2.5.0/docs/widgets/text/format/index.rst +17 -0
- aiogram_dialog-2.5.0/docs/widgets/text/index.rst +26 -0
- aiogram_dialog-2.5.0/docs/widgets/text/jinja/example.html +4 -0
- aiogram_dialog-2.5.0/docs/widgets/text/jinja/example.py +31 -0
- aiogram_dialog-2.5.0/docs/widgets/text/jinja/index.rst +24 -0
- aiogram_dialog-2.5.0/docs/widgets/text/list/example.py +23 -0
- aiogram_dialog-2.5.0/docs/widgets/text/list/index.rst +16 -0
- aiogram_dialog-2.5.0/docs/widgets/text/multi/example.py +28 -0
- aiogram_dialog-2.5.0/docs/widgets/text/multi/index.rst +8 -0
- aiogram_dialog-2.5.0/docs/widgets/text/progress/bg_manager_example.py +10 -0
- aiogram_dialog-2.5.0/docs/widgets/text/progress/example.py +47 -0
- aiogram_dialog-2.5.0/docs/widgets/text/progress/index.rst +29 -0
- aiogram_dialog-2.5.0/docs/widgets/text/progress/prevent_new_message.py +13 -0
- aiogram_dialog-2.5.0/example/custom_media_url.py +120 -0
- aiogram_dialog-2.5.0/example/i18n/bot.py +95 -0
- aiogram_dialog-2.5.0/example/i18n/i18n_format.py +28 -0
- aiogram_dialog-2.5.0/example/i18n/i18n_middleware.py +41 -0
- aiogram_dialog-2.5.0/example/i18n/translations/en/main.ftl +3 -0
- aiogram_dialog-2.5.0/example/input_media_group.py +113 -0
- aiogram_dialog-2.5.0/example/launch_modes.py +102 -0
- aiogram_dialog-2.5.0/example/list_group.py +108 -0
- aiogram_dialog-2.5.0/example/loading.py +105 -0
- aiogram_dialog-2.5.0/example/mega/bot.py +101 -0
- aiogram_dialog-2.5.0/example/mega/bot_dialogs/__init__.py +0 -0
- aiogram_dialog-2.5.0/example/mega/bot_dialogs/calendar.py +168 -0
- aiogram_dialog-2.5.0/example/mega/bot_dialogs/common.py +11 -0
- aiogram_dialog-2.5.0/example/mega/bot_dialogs/counter.py +48 -0
- aiogram_dialog-2.5.0/example/mega/bot_dialogs/layouts.py +89 -0
- aiogram_dialog-2.5.0/example/mega/bot_dialogs/link_preview.py +84 -0
- aiogram_dialog-2.5.0/example/mega/bot_dialogs/main.py +60 -0
- aiogram_dialog-2.5.0/example/mega/bot_dialogs/mutltiwidget.py +38 -0
- aiogram_dialog-2.5.0/example/mega/bot_dialogs/reply_buttons.py +40 -0
- aiogram_dialog-2.5.0/example/mega/bot_dialogs/scrolls.py +276 -0
- aiogram_dialog-2.5.0/example/mega/bot_dialogs/select.py +201 -0
- aiogram_dialog-2.5.0/example/mega/bot_dialogs/states.py +63 -0
- aiogram_dialog-2.5.0/example/mega/bot_dialogs/switch.py +72 -0
- aiogram_dialog-2.5.0/example/mega/media/1.png +0 -0
- aiogram_dialog-2.5.0/example/mega/media/2.png +0 -0
- aiogram_dialog-2.5.0/example/mega/media/3.png +0 -0
- aiogram_dialog-2.5.0/example/mega/media/4.png +0 -0
- aiogram_dialog-2.5.0/example/mega/media/5.png +0 -0
- aiogram_dialog-2.5.0/example/mega/media/6.png +0 -0
- aiogram_dialog-2.5.0/example/mega/media/7.png +0 -0
- aiogram_dialog-2.5.0/example/multistack.py +116 -0
- aiogram_dialog-2.5.0/example/python_logo.png +0 -0
- aiogram_dialog-2.5.0/example/scrolls.py +257 -0
- aiogram_dialog-2.5.0/example/simple.py +186 -0
- aiogram_dialog-2.5.0/example/subdialog.py +169 -0
- aiogram_dialog-2.5.0/example/wizard.py +131 -0
- aiogram_dialog-2.5.0/make.bat +35 -0
- aiogram_dialog-2.5.0/pyproject.toml +68 -0
- aiogram_dialog-2.5.0/requirements_dev.txt +5 -0
- aiogram_dialog-2.5.0/requirements_doc.txt +4 -0
- aiogram_dialog-2.5.0/setup.cfg +4 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/__init__.py +44 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/_version.py +13 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/about.py +62 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/__init__.py +0 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/entities/__init__.py +43 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/entities/access.py +8 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/entities/context.py +29 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/entities/events.py +35 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/entities/launch_mode.py +38 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/entities/media.py +49 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/entities/modes.py +64 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/entities/new_message.py +52 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/entities/stack.py +82 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/entities/update_event.py +67 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/exceptions.py +60 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/internal/__init__.py +47 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/internal/fake_data.py +27 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/internal/manager.py +20 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/internal/middleware.py +5 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/internal/widgets.py +142 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/internal/window.py +57 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/protocols/__init__.py +26 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/protocols/dialog.py +70 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/protocols/manager.py +198 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/protocols/media.py +27 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/protocols/message_manager.py +37 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/protocols/registry.py +16 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/api/protocols/stack_access.py +18 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/context/__init__.py +0 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/context/access_validator.py +37 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/context/intent_filter.py +21 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/context/intent_middleware.py +563 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/context/media_storage.py +60 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/context/storage.py +190 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/dialog.py +229 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/manager/__init__.py +0 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/manager/bg_manager.py +288 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/manager/manager.py +612 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/manager/manager_factory.py +35 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/manager/manager_middleware.py +80 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/manager/message_manager.py +433 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/manager/sub_manager.py +164 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/manager/update_handler.py +39 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/manager/updater.py +35 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/py.typed +1 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/setup.py +249 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/test_tools/__init__.py +7 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/test_tools/bot_client.py +158 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/test_tools/keyboard.py +71 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/test_tools/memory_storage.py +43 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/test_tools/mock_message_manager.py +158 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/tools/__init__.py +7 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/tools/calculator.png +0 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/tools/preview.py +485 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/tools/templates/__init__.py +0 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/tools/templates/message.html +289 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/tools/transitions.py +121 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/tools/web_preview.py +115 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/utils.py +239 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/__init__.py +0 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/common/__init__.py +31 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/common/action.py +43 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/common/base.py +12 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/common/case.py +27 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/common/items.py +36 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/common/managed.py +18 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/common/scroll.py +102 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/common/when.py +69 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/data/__init__.py +13 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/data/data_context.py +37 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/input/__init__.py +12 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/input/base.py +68 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/input/combined.py +40 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/input/text.py +110 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/kbd/__init__.py +97 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/kbd/base.py +168 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/kbd/button.py +310 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/kbd/calendar_kbd.py +1044 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/kbd/checkbox.py +151 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/kbd/copy.py +44 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/kbd/counter.py +201 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/kbd/group.py +98 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/kbd/list_group.py +177 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/kbd/pager.py +357 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/kbd/request.py +105 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/kbd/scrolling_group.py +125 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/kbd/select.py +539 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/kbd/state.py +188 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/kbd/stub_scroll.py +67 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/kbd/time.py +269 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/link_preview/__init__.py +3 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/link_preview/base.py +63 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/markup/__init__.py +0 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/markup/force_reply.py +35 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/markup/inline_keyboard.py +20 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/markup/reply_keyboard.py +46 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/media/__init__.py +11 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/media/base.py +61 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/media/dynamic.py +35 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/media/scroll.py +53 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/media/static.py +57 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/style/__init__.py +9 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/style/base.py +149 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/style/multi.py +58 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/text/__init__.py +20 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/text/base.py +165 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/text/format.py +39 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/text/jinja.py +83 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/text/list.py +76 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/text/multi.py +48 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/text/progress.py +31 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/text/scrolling_text.py +50 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/utils.py +151 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/widgets/widget_event.py +44 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog/window.py +189 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog.egg-info/PKG-INFO +157 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog.egg-info/SOURCES.txt +384 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog.egg-info/dependency_links.txt +1 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog.egg-info/entry_points.txt +2 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog.egg-info/requires.txt +7 -0
- aiogram_dialog-2.5.0/src/aiogram_dialog.egg-info/top_level.txt +1 -0
- aiogram_dialog-2.5.0/tests/test_click.py +103 -0
- aiogram_dialog-2.5.0/tests/test_create.py +43 -0
- aiogram_dialog-2.5.0/tests/test_dialog_state_validation.py +50 -0
- aiogram_dialog-2.5.0/tests/test_events.py +77 -0
- aiogram_dialog-2.5.0/tests/test_exception_notes.py +77 -0
- aiogram_dialog-2.5.0/tests/test_group.py +177 -0
- aiogram_dialog-2.5.0/tests/test_isolation.py +45 -0
- aiogram_dialog-2.5.0/tests/test_nested_transitions.py +103 -0
- aiogram_dialog-2.5.0/tests/test_transitions.py +162 -0
- aiogram_dialog-2.5.0/tests/test_utils.py +14 -0
- aiogram_dialog-2.5.0/tests/widgets/__init__.py +0 -0
- aiogram_dialog-2.5.0/tests/widgets/conftest.py +23 -0
- aiogram_dialog-2.5.0/tests/widgets/kbd/__init__.py +0 -0
- aiogram_dialog-2.5.0/tests/widgets/kbd/test_base.py +42 -0
- aiogram_dialog-2.5.0/tests/widgets/kbd/test_calendar.py +19 -0
- aiogram_dialog-2.5.0/tests/widgets/kbd/test_checkbox.py +38 -0
- aiogram_dialog-2.5.0/tests/widgets/kbd/test_column.py +26 -0
- aiogram_dialog-2.5.0/tests/widgets/kbd/test_counter.py +54 -0
- aiogram_dialog-2.5.0/tests/widgets/kbd/test_group.py +118 -0
- aiogram_dialog-2.5.0/tests/widgets/kbd/test_multiselect.py +129 -0
- aiogram_dialog-2.5.0/tests/widgets/kbd/test_radio.py +77 -0
- aiogram_dialog-2.5.0/tests/widgets/kbd/test_row.py +23 -0
- aiogram_dialog-2.5.0/tests/widgets/kbd/test_select.py +24 -0
- aiogram_dialog-2.5.0/tests/widgets/kbd/test_time.py +31 -0
- aiogram_dialog-2.5.0/tests/widgets/kbd/test_toggle.py +31 -0
- aiogram_dialog-2.5.0/tests/widgets/kbd/test_url.py +17 -0
- aiogram_dialog-2.5.0/tests/widgets/media/__init__.py +0 -0
- aiogram_dialog-2.5.0/tests/widgets/media/test_base.py +43 -0
- aiogram_dialog-2.5.0/tests/widgets/media/test_media_message.py +67 -0
- aiogram_dialog-2.5.0/tests/widgets/media/test_media_storage.py +50 -0
- aiogram_dialog-2.5.0/tests/widgets/media/test_scroll.py +26 -0
- aiogram_dialog-2.5.0/tests/widgets/style/__init__.py +0 -0
- aiogram_dialog-2.5.0/tests/widgets/style/test_base.py +35 -0
- aiogram_dialog-2.5.0/tests/widgets/text/__init__.py +0 -0
- aiogram_dialog-2.5.0/tests/widgets/text/test_base.py +61 -0
- aiogram_dialog-2.5.0/tests/widgets/text/test_case.py +21 -0
- aiogram_dialog-2.5.0/tests/widgets/text/test_format.py +14 -0
- aiogram_dialog-2.5.0/tests/widgets/text/test_jinja.py +36 -0
- aiogram_dialog-2.5.0/tests/widgets/text/test_multi.py +18 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: Upload Python Package to PyPI when a new Release is Created
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [created]
|
|
6
|
+
|
|
7
|
+
env:
|
|
8
|
+
UV_PYTHON_DOWNLOADS: 0
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
name: Build distribution
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
permissions: {}
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout
|
|
17
|
+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
|
18
|
+
with:
|
|
19
|
+
persist-credentials: false
|
|
20
|
+
|
|
21
|
+
- name: Set up Python 3.13
|
|
22
|
+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
|
|
23
|
+
with:
|
|
24
|
+
python-version: "3.13"
|
|
25
|
+
|
|
26
|
+
- name: Install uv
|
|
27
|
+
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
|
|
28
|
+
|
|
29
|
+
- name: Build
|
|
30
|
+
run: uv build
|
|
31
|
+
|
|
32
|
+
- name: Upload artifact
|
|
33
|
+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
|
34
|
+
with:
|
|
35
|
+
name: python-package-distributions
|
|
36
|
+
path: dist/*
|
|
37
|
+
|
|
38
|
+
publish:
|
|
39
|
+
name: Publish to PyPI
|
|
40
|
+
needs: build
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
environment:
|
|
43
|
+
name: pypi
|
|
44
|
+
permissions:
|
|
45
|
+
id-token: write
|
|
46
|
+
contents: read
|
|
47
|
+
|
|
48
|
+
steps:
|
|
49
|
+
- name: Download artifact
|
|
50
|
+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
|
|
51
|
+
with:
|
|
52
|
+
name: python-package-distributions
|
|
53
|
+
path: dist/
|
|
54
|
+
|
|
55
|
+
- name: Install uv
|
|
56
|
+
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
|
|
57
|
+
|
|
58
|
+
- name: Publish
|
|
59
|
+
run: uv publish
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
|
2
|
+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
|
3
|
+
|
|
4
|
+
name: CI
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: [develop]
|
|
9
|
+
paths-ignore:
|
|
10
|
+
- "docs/**"
|
|
11
|
+
pull_request:
|
|
12
|
+
branches: [develop]
|
|
13
|
+
paths-ignore:
|
|
14
|
+
- "docs/**"
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
cpython:
|
|
18
|
+
runs-on: ${{ matrix.os }}
|
|
19
|
+
strategy:
|
|
20
|
+
matrix:
|
|
21
|
+
os:
|
|
22
|
+
- ubuntu-latest
|
|
23
|
+
python-version:
|
|
24
|
+
- "3.10"
|
|
25
|
+
- "3.11"
|
|
26
|
+
- "3.12"
|
|
27
|
+
- "3.13"
|
|
28
|
+
- "3.14"
|
|
29
|
+
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
|
32
|
+
with:
|
|
33
|
+
persist-credentials: false
|
|
34
|
+
- name: Set up ${{ matrix.python-version }} on ${{ matrix.os }}
|
|
35
|
+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
|
|
36
|
+
with:
|
|
37
|
+
python-version: ${{ matrix.python-version }}
|
|
38
|
+
|
|
39
|
+
- name: "Install uv"
|
|
40
|
+
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
|
|
41
|
+
|
|
42
|
+
- name: "Install dependencies"
|
|
43
|
+
run: |
|
|
44
|
+
uv pip install . -r requirements_dev.txt --system
|
|
45
|
+
uv pip install diagrams --system
|
|
46
|
+
|
|
47
|
+
- name: "Run Ruff"
|
|
48
|
+
run: ruff check
|
|
49
|
+
|
|
50
|
+
- name: "Run tests"
|
|
51
|
+
run: |
|
|
52
|
+
pytest
|
|
53
|
+
|
|
54
|
+
- name: "Run vulture"
|
|
55
|
+
run: |
|
|
56
|
+
python -m vulture src/aiogram_dialog --min-confidence 70
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
line-length = 79
|
|
2
|
+
target-version = "py310"
|
|
3
|
+
|
|
4
|
+
include = ["src/**.py", "tests/**.py", "example/**.py"]
|
|
5
|
+
exclude = [
|
|
6
|
+
"docs",
|
|
7
|
+
"src/aiogram_dialog/_version.py",
|
|
8
|
+
]
|
|
9
|
+
|
|
10
|
+
lint.select = ["ALL"]
|
|
11
|
+
lint.ignore = [
|
|
12
|
+
"ANN",
|
|
13
|
+
"ARG",
|
|
14
|
+
"D",
|
|
15
|
+
"DTZ",
|
|
16
|
+
"TD",
|
|
17
|
+
"A002",
|
|
18
|
+
"ASYNC230",
|
|
19
|
+
"BLE001",
|
|
20
|
+
"EM101",
|
|
21
|
+
"EM102",
|
|
22
|
+
"FA100",
|
|
23
|
+
"FBT001",
|
|
24
|
+
"FBT002",
|
|
25
|
+
"FIX002",
|
|
26
|
+
"ISC002",
|
|
27
|
+
"ISC003",
|
|
28
|
+
"N818",
|
|
29
|
+
"PERF401",
|
|
30
|
+
"PLR0913",
|
|
31
|
+
"PLW2901",
|
|
32
|
+
"PYI034",
|
|
33
|
+
"RET505",
|
|
34
|
+
"S311",
|
|
35
|
+
"SIM103",
|
|
36
|
+
"SIM108",
|
|
37
|
+
"SIM114",
|
|
38
|
+
"TC001",
|
|
39
|
+
"TC002",
|
|
40
|
+
"TC003",
|
|
41
|
+
"TC006", # Add quotes to type expression in `typing.cast()`
|
|
42
|
+
"TRY003",
|
|
43
|
+
"TRY201",
|
|
44
|
+
"TRY400",
|
|
45
|
+
"PLW1641",
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
[lint.per-file-ignores]
|
|
50
|
+
"src/aiogram_dialog/tools/**" = [
|
|
51
|
+
"S101",
|
|
52
|
+
"SLF001",
|
|
53
|
+
"PTH",
|
|
54
|
+
]
|
|
55
|
+
"src/aiogram_dialog/test_tools/**" = [
|
|
56
|
+
"S101",
|
|
57
|
+
"PTH"
|
|
58
|
+
]
|
|
59
|
+
"tests/**" = [
|
|
60
|
+
"TID252",
|
|
61
|
+
"PLR2004",
|
|
62
|
+
"S101",
|
|
63
|
+
"INP001",
|
|
64
|
+
"FBT003",
|
|
65
|
+
]
|
|
66
|
+
"example/**" = [
|
|
67
|
+
"INP001",
|
|
68
|
+
"ERA001",
|
|
69
|
+
"RUF001",
|
|
70
|
+
"PTH",
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
[lint.isort]
|
|
74
|
+
no-lines-before = ["local-folder"]
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line, and also
|
|
5
|
+
# from the environment for the first two.
|
|
6
|
+
SPHINXOPTS ?=
|
|
7
|
+
SPHINXBUILD ?= sphinx-build
|
|
8
|
+
SOURCEDIR = docs
|
|
9
|
+
BUILDDIR = build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aiogram_dialog
|
|
3
|
+
Version: 2.5.0
|
|
4
|
+
Summary: Telegram bot UI framework on top of aiogram
|
|
5
|
+
Author-email: Andrey Tikhonov <17@itishka.org>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/tishka17/aiogram_dialog
|
|
8
|
+
Project-URL: Documentation, https://aiogram-dialog.readthedocs.org
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/tishka17/aiogram_dialog/issues
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Requires-Python: >=3.10
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: aiogram>=3.14.0
|
|
22
|
+
Requires-Dist: jinja2
|
|
23
|
+
Requires-Dist: cachetools<6.0.0,>=4.0.0
|
|
24
|
+
Provides-Extra: tools
|
|
25
|
+
Requires-Dist: diagrams; extra == "tools"
|
|
26
|
+
Requires-Dist: aiohttp; extra == "tools"
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# Aiogram Dialog
|
|
30
|
+
|
|
31
|
+
[](https://badge.fury.io/py/aiogram-dialog)
|
|
32
|
+
[](https://aiogram-dialog.readthedocs.io)
|
|
33
|
+
[](https://pypistats.org/packages/aiogram_dialog)
|
|
34
|
+
[](https://github.com/Tishka17/aiogram_dialog/blob/master/LICENSE)
|
|
35
|
+
[](https://t.me/aiogram_dialog)
|
|
36
|
+
|
|
37
|
+
#### Version status:
|
|
38
|
+
* v2.x - actual release, supports aiogram v3.x
|
|
39
|
+
* v1.x - old release, supports aiogram v2.x, critical fix only
|
|
40
|
+
|
|
41
|
+
### About
|
|
42
|
+
`aiogram-dialog` is a framework for developing interactive messages and menus in your telegram bot like a normal GUI application.
|
|
43
|
+
|
|
44
|
+
It is inspired by ideas of Android SDK and other tools.
|
|
45
|
+
|
|
46
|
+
Main ideas are:
|
|
47
|
+
* **split data retrieving, rendering and action processing** - you need nothing to do for showing same content after some actions, also you can show same data in multiple ways.
|
|
48
|
+
* **reusable widgets** - you can create calendar or multiselect at any point of your application without copy-pasting its internal logic
|
|
49
|
+
* **limited scope of context** - any dialog keeps some data until closed, multiple opened dialogs process their data separately
|
|
50
|
+
|
|
51
|
+
Designing you bot with `aiogram-dialog` you **think about user**, what he sees and what he does. Then you split this vision into reusable parts and design your bot combining dialogs, widows and widgets. By this moment you can review interface and add your core logic.
|
|
52
|
+
|
|
53
|
+
Many components are ready for use, but you can extend and add your own widgets and even core features.
|
|
54
|
+
|
|
55
|
+
For more details see [documentation](https://aiogram-dialog.readthedocs.io) and [examples](example)
|
|
56
|
+
|
|
57
|
+
### Supported features:
|
|
58
|
+
* Rich text rendering using `format` function or `Jinja2` template engine.
|
|
59
|
+
* Automatic message updating after user actions
|
|
60
|
+
* Multiple independent dialog stacks with own data storage and transitions
|
|
61
|
+
* Inline keyboard widgets like `SwitchTo`, `Start`, `Cancel` for state switching, `Calendar` for date selection and others.
|
|
62
|
+
* Stateful widgets: `Checkbox`, `Multiselect`, `Counter`, `TextInput`. They record user actions and allow you to retrieve this data later.
|
|
63
|
+
* Multiple buttons layouts including simple grouping (`Group`, `Column`), page scrolling (`ScrollingGroup`), repeating of same buttons for list of data (`ListGroup`).
|
|
64
|
+
* Sending media (like photo or video) with fileid caching and handling switching to/from message with no media.
|
|
65
|
+
* Different rules of transitions between windows/dialogs like keeping only one dialog on top of stack or force sending new message instead of updating one.
|
|
66
|
+
* Offline HTML-preview for messages and transitions diagram. They can be used to check all states without emulating real use cases or exported for demonstration purposes.
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### Usage
|
|
70
|
+
|
|
71
|
+
Example below is suitable for aiogram_dialog v2.x and aiogram v3.x
|
|
72
|
+
|
|
73
|
+
#### Declaring Window
|
|
74
|
+
|
|
75
|
+
Each window consists of:
|
|
76
|
+
|
|
77
|
+
* Text widgets. Render text of message.
|
|
78
|
+
* Keyboard widgets. Render inline keyboard
|
|
79
|
+
* Media widget. Renders media if need
|
|
80
|
+
* Message handler. Called when user sends a message when window is shown
|
|
81
|
+
* Data getter functions (`getter=`). They load data from any source which can be used in text/keyboard
|
|
82
|
+
* State. Used when switching between windows
|
|
83
|
+
|
|
84
|
+
**Info:** always create `State` inside `StatesGroup`
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
from aiogram.fsm.state import StatesGroup, State
|
|
89
|
+
from aiogram_dialog.widgets.text import Format, Const
|
|
90
|
+
from aiogram_dialog.widgets.kbd import Button
|
|
91
|
+
from aiogram_dialog import Window
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
class MySG(StatesGroup):
|
|
95
|
+
main = State()
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
async def get_data(**kwargs):
|
|
99
|
+
return {"name": "world"}
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
Window(
|
|
103
|
+
Format("Hello, {name}!"),
|
|
104
|
+
Button(Const("Empty button"), id="nothing"),
|
|
105
|
+
state=MySG.main,
|
|
106
|
+
getter=get_data,
|
|
107
|
+
)
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Declaring dialog
|
|
111
|
+
|
|
112
|
+
Window itself can do nothing, just prepares message. To use it you need dialog:
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
from aiogram.fsm.state import StatesGroup, State
|
|
116
|
+
from aiogram_dialog import Dialog, Window
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
class MySG(StatesGroup):
|
|
120
|
+
first = State()
|
|
121
|
+
second = State()
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
dialog = Dialog(
|
|
125
|
+
Window(..., state=MySG.first),
|
|
126
|
+
Window(..., state=MySG.second),
|
|
127
|
+
)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
> **Info:** All windows in a dialog MUST have states from then same `StatesGroup`
|
|
131
|
+
|
|
132
|
+
After creating a dialog you need to register it into the Dispatcher and set it up using the `setup_dialogs` function:
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
from aiogram import Dispatcher
|
|
136
|
+
from aiogram_dialog import setup_dialogs
|
|
137
|
+
|
|
138
|
+
...
|
|
139
|
+
dp = Dispatcher(storage=storage) # create as usual
|
|
140
|
+
dp.include_router(dialog)
|
|
141
|
+
setup_dialogs(dp)
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Then start dialog when you are ready to use it. Dialog is started via `start` method of `DialogManager` instance. You
|
|
145
|
+
should provide corresponding state to switch into (usually it is state of first window in dialog).
|
|
146
|
+
|
|
147
|
+
For example in `/start` command handler:
|
|
148
|
+
|
|
149
|
+
```python
|
|
150
|
+
async def user_start(message: Message, dialog_manager: DialogManager):
|
|
151
|
+
await dialog_manager.start(MySG.first, mode=StartMode.RESET_STACK)
|
|
152
|
+
|
|
153
|
+
dp.message.register(user_start, CommandStart())
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
> **Info:** Always set `mode=StartMode.RESET_STACK` in your top level start command. Otherwise, dialogs are stacked just as they do
|
|
157
|
+
on your mobile phone, so you can reach stackoverflow error
|