python-trueconf-bot 1.4.0__tar.gz → 1.4.1__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.
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/PKG-INFO +1 -1
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/python_trueconf_bot.egg-info/PKG-INFO +1 -1
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/tests/test_fsm.py +25 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/_version.py +3 -3
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/client/bot.py +28 -22
- python_trueconf_bot-1.4.1/trueconf/fsm/middleware.py +33 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/base.py +1 -1
- python_trueconf_bot-1.4.0/trueconf/fsm/middleware.py +0 -24
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/.github/workflows/docs.yml +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/.github/workflows/release-test.yml +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/.github/workflows/release.yml +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/.gitignore +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/.opencode/plans/2026-05-25-fsm-implementation.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/LICENSE +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/README-PyPI.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/README-ru.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/README.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/assets/head_en.png +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/assets/head_ru.png +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/assets/logo.svg +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/context7.json +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/examples/index.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/features.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/img/head.png +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/img/router_scheme_en.svg +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/index.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/learn/enums.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/learn/files.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/learn/filters.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/learn/fsm.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/learn/getting-started.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/learn/middleware.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/learn/parse-messages.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/learn/restrictions.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/learn/send_message.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/learn/shortcuts.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/learn/types.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/reference/Bot.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/reference/Dispatcher.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/reference/Enums.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/reference/Exceptions.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/reference/Formatting.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/reference/Responses.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/reference/Router.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/reference/Types.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/reference/index.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/en/release_notes.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/hooks/llms_txt.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/img/chatbot.svg +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/img/favicon.ico +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/img/logo.svg +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/overrides/main.html +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/ru/examples/index.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/ru/features.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/ru/img/head.png +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/ru/img/router_scheme_ru.svg +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/ru/index.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/ru/learn/enums.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/ru/learn/files.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/ru/learn/filters.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/ru/learn/fsm.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/ru/learn/getting-started.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/ru/learn/middleware.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/ru/learn/parse-messages.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/ru/learn/restrictions.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/ru/learn/send_message.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/ru/learn/shortcuts.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/ru/learn/types.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/ru/release_notes.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/docs/stylesheets/extra.css +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/examples/README-ru.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/examples/README.md +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/examples/add_big_list_users_to_channel.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/examples/filters.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/examples/report_bot.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/examples/update_token.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/examples/webhook.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/mkdocs.yml +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/pyproject.toml +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/python_trueconf_bot.egg-info/SOURCES.txt +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/python_trueconf_bot.egg-info/dependency_links.txt +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/python_trueconf_bot.egg-info/requires.txt +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/python_trueconf_bot.egg-info/top_level.txt +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/requirements-docs.txt +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/requirements.txt +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/setup.cfg +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/test5.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/__init__.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/client/__init__.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/client/context_controller.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/client/session.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/dispatcher/__init__.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/dispatcher/dispatcher.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/dispatcher/router.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/enums/__init__.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/enums/aouth_error.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/enums/chat_participant_role.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/enums/chat_type.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/enums/envelope_author_type.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/enums/file_ready_state.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/enums/incoming_update_method.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/enums/message_type.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/enums/parse_mode.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/enums/survey_type.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/enums/update_type.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/exceptions.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/filters/__init__.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/filters/base.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/filters/command.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/filters/instance_of.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/filters/message.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/filters/method.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/fsm/__init__.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/fsm/context.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/fsm/filters.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/fsm/key_builder.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/fsm/manager.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/fsm/state.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/fsm/storage/__init__.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/fsm/storage/base.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/fsm/storage/memory.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/fsm/strategy.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/loggers.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/__init__.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/add_participant_to_chat.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/auth.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/change_participant_role.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/clear_chat_history.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/create_channel.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/create_favorites_chat.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/create_group_chat.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/create_p2p_chat.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/edit_chat_avatar.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/edit_chat_title.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/edit_message.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/edit_survey.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/forward_message.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/get_chat_by_id.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/get_chat_history.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/get_chat_participant.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/get_chat_participants.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/get_chats.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/get_file_info.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/get_file_upload_limits.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/get_message_by_id.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/get_user_display_name.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/has_chat_participant.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/remove_chat.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/remove_message.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/remove_participant_from_chat.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/send_file.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/send_message.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/send_survey.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/subscribe_file_progress.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/unsubscribe_file_progress.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/methods/upload_file.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/middleware.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/py.typed +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/__init__.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/author_box.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/chat_participant.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/content/__init__.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/content/attachment.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/content/base.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/content/chat_created.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/content/document.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/content/edit_chat_title.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/content/forward_message.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/content/location.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/content/photo.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/content/remove_participant.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/content/sticker.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/content/survey.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/content/text.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/content/video.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/input_file.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/last_message.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/message.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/parser.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/requests/__init__.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/requests/added_chat_participant.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/requests/changed_file_upload_limits.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/requests/changed_participant_role.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/requests/cleared_chat_history.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/requests/created_channel.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/requests/created_favorites_chat.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/requests/created_group_chat.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/requests/created_personal_chat.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/requests/edited_chat_avatar.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/requests/edited_chat_title.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/requests/edited_message.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/requests/removed_chat.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/requests/removed_chat_participant.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/requests/removed_message.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/requests/uploading_progress.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/__init__.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/add_chat_participant_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/api_error.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/auth_response_payload.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/change_participant_role_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/clear_chat_history_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/create_channel_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/create_favorites_chat_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/create_group_chat_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/create_p2p_chat_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/edit_chat_avatar_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/edit_chat_title_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/edit_message_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/edit_survey_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/forward_message_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/get_chat_by_id_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/get_chat_history_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/get_chat_participant_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/get_chat_participants_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/get_chats_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/get_file_info_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/get_file_upload_limits_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/get_message_by_id_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/get_user_display_name_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/has_chat_participant_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/remove_chat_participant_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/remove_chat_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/remove_message_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/send_file_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/send_message_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/send_survey_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/subscribe_file_progress_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/unsubscribe_file_progress_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/responses/upload_file_response.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/types/update.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/utils/__init__.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/utils/_generate_secret_for_survey.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/utils/_ssl.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/utils/_token.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/utils/_version_checker.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/utils/formatting/__init__.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/utils/formatting/decorations.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/utils/formatting/text.py +0 -0
- {python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/utils/split_text.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-trueconf-bot
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.1
|
|
4
4
|
Summary: Lightweight and powerful framework for the TrueConf Server Chatbot API
|
|
5
5
|
Author-email: TrueConf LLC <info@trueconf.com>, Anton Baadzhi <baadzhianton@gmail.com>
|
|
6
6
|
License-Expression: BSD-3-Clause-Clear
|
{python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/python_trueconf_bot.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-trueconf-bot
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.1
|
|
4
4
|
Summary: Lightweight and powerful framework for the TrueConf Server Chatbot API
|
|
5
5
|
Author-email: TrueConf LLC <info@trueconf.com>, Anton Baadzhi <baadzhianton@gmail.com>
|
|
6
6
|
License-Expression: BSD-3-Clause-Clear
|
|
@@ -341,6 +341,31 @@ class TestFSMMiddleware:
|
|
|
341
341
|
await mw(handler, _make_message(), data)
|
|
342
342
|
assert "state" not in data
|
|
343
343
|
|
|
344
|
+
async def test_system_event_without_chat_id_skips_fsm(self):
|
|
345
|
+
"""System events like ChangedFileUploadLimits have no chat_id/user_id — FSM should skip."""
|
|
346
|
+
from dataclasses import dataclass
|
|
347
|
+
|
|
348
|
+
@dataclass
|
|
349
|
+
class FakeSystemEvent:
|
|
350
|
+
"""Simulates a system event without chat_id or author."""
|
|
351
|
+
max_size: int = 1000
|
|
352
|
+
|
|
353
|
+
storage = MemoryStorage()
|
|
354
|
+
fsm = FSMManager(storage=storage)
|
|
355
|
+
mw = FSMMiddleware(fsm)
|
|
356
|
+
data: dict = {"bot": FakeBot()}
|
|
357
|
+
|
|
358
|
+
received_data: dict = {}
|
|
359
|
+
|
|
360
|
+
async def handler(evt, d):
|
|
361
|
+
received_data.update(d)
|
|
362
|
+
|
|
363
|
+
event = FakeSystemEvent(max_size=5000)
|
|
364
|
+
await mw(handler, event, data)
|
|
365
|
+
|
|
366
|
+
assert "state" not in received_data
|
|
367
|
+
assert "raw_state" not in received_data
|
|
368
|
+
|
|
344
369
|
|
|
345
370
|
# ──────────────────────────────────────────────
|
|
346
371
|
# Dispatcher integration
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '1.4.
|
|
22
|
-
__version_tuple__ = version_tuple = (1, 4,
|
|
21
|
+
__version__ = version = '1.4.1'
|
|
22
|
+
__version_tuple__ = version_tuple = (1, 4, 1)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g919be661a'
|
|
@@ -66,7 +66,7 @@ from trueconf.types.input_file import InputFile, URLInputFile
|
|
|
66
66
|
from trueconf.types.parser import parse_update
|
|
67
67
|
from trueconf.types.requests.uploading_progress import UploadingProgress
|
|
68
68
|
from trueconf.types.requests.changed_file_upload_limits import ChangedFileUploadLimits
|
|
69
|
-
from trueconf.types.responses import GetFileUploadLimitsResponse, ApiError
|
|
69
|
+
from trueconf.types.responses import GetFileUploadLimitsResponse, ApiError
|
|
70
70
|
from trueconf.types.responses.add_chat_participant_response import AddChatParticipantResponse
|
|
71
71
|
from trueconf.types.responses.change_participant_role_response import ChangeParticipantRoleResponse
|
|
72
72
|
from trueconf.types.responses.clear_chat_history_response import ClearChatHistoryResponse
|
|
@@ -133,6 +133,7 @@ class Bot:
|
|
|
133
133
|
ws_max_delay: int = 60,
|
|
134
134
|
debug: bool = False,
|
|
135
135
|
on_health_check: HealthCheckCallback | None = None,
|
|
136
|
+
timeout: float| int = 10.0
|
|
136
137
|
):
|
|
137
138
|
"""
|
|
138
139
|
Initializes a TrueConf chatbot instance with WebSocket connection and configuration options.
|
|
@@ -163,6 +164,9 @@ class Bot:
|
|
|
163
164
|
connection health changes. The callback receives a dictionary with the current status,
|
|
164
165
|
WebSocket state, authorization state, server, port, protocol, timestamp, and optional
|
|
165
166
|
error details. Defaults to None.
|
|
167
|
+
timeout (float | int, optional): The maximum time in seconds to wait for network activity.
|
|
168
|
+
Instead of limiting the total upload duration, it protects against socket freezes during data
|
|
169
|
+
transmission and waiting for the server's response. Defaults to 10.0.
|
|
166
170
|
|
|
167
171
|
Note:
|
|
168
172
|
Alternatively, you can authorize using a username and password via the `from_credentials()` class method.
|
|
@@ -202,6 +206,7 @@ class Bot:
|
|
|
202
206
|
self.file_extensions_list: set | None = None
|
|
203
207
|
self._me_id: str
|
|
204
208
|
self._on_health_check = on_health_check
|
|
209
|
+
self.timeout = timeout
|
|
205
210
|
|
|
206
211
|
if skip_self_messages:
|
|
207
212
|
from trueconf.middleware import SkipSelfMessages
|
|
@@ -216,7 +221,7 @@ class Bot:
|
|
|
216
221
|
async def __call__(self, method: TrueConfMethod[T]) -> T:
|
|
217
222
|
loggers.chatbot.info(f"📤 API call: {type(method).__name__}(id={method.id})")
|
|
218
223
|
try:
|
|
219
|
-
result = await method(self)
|
|
224
|
+
result = await method(self, timeout=self.timeout)
|
|
220
225
|
loggers.chatbot.info(
|
|
221
226
|
f"✅ API response: {type(method).__name__}(id={method.id})"
|
|
222
227
|
)
|
|
@@ -229,7 +234,7 @@ class Bot:
|
|
|
229
234
|
|
|
230
235
|
async def __get_domain_name(self):
|
|
231
236
|
try:
|
|
232
|
-
async with httpx.AsyncClient(verify=self.ssl_context, timeout=
|
|
237
|
+
async with httpx.AsyncClient(verify=self.ssl_context, timeout=self.timeout) as client:
|
|
233
238
|
response = await client.get(f"{self._protocol}://{self.server}:{self.port}/api/v4/server")
|
|
234
239
|
domain_name = response.json().get("product").get("display_name")
|
|
235
240
|
loggers.chatbot.info(f"🌐 Server domain_name resolved: {domain_name}")
|
|
@@ -240,7 +245,7 @@ class Bot:
|
|
|
240
245
|
|
|
241
246
|
async def __get_server_version(self):
|
|
242
247
|
try:
|
|
243
|
-
async with httpx.AsyncClient(verify=self.ssl_context, timeout=
|
|
248
|
+
async with httpx.AsyncClient(verify=self.ssl_context, timeout=self.timeout) as client:
|
|
244
249
|
response = await client.get(f"{self._protocol}://{self.server}:{self.port}/api/v4/server")
|
|
245
250
|
version = response.json().get("product").get("version")
|
|
246
251
|
loggers.chatbot.info(f"📦 Server version resolved: {version}")
|
|
@@ -337,6 +342,7 @@ class Bot:
|
|
|
337
342
|
ws_max_delay: int = 60,
|
|
338
343
|
debug: bool = False,
|
|
339
344
|
on_health_check: HealthCheckCallback | None = None,
|
|
345
|
+
timeout: float | int = 10.0
|
|
340
346
|
) -> Self:
|
|
341
347
|
"""
|
|
342
348
|
Creates a bot instance using username and password authentication.
|
|
@@ -363,6 +369,9 @@ class Bot:
|
|
|
363
369
|
debug (bool, optional): Enables debug mode. Defaults to False.
|
|
364
370
|
on_health_check (HealthCheckCallback | None, optional): Async callback called when the bot
|
|
365
371
|
connection health changes. Defaults to None.
|
|
372
|
+
timeout (float | int, optional): The maximum time in seconds to wait for network activity.
|
|
373
|
+
Instead of limiting the total upload duration, it protects against socket freezes during data
|
|
374
|
+
transmission and waiting for the server's response. Defaults to 10.0.
|
|
366
375
|
|
|
367
376
|
Returns:
|
|
368
377
|
Bot: An authorized bot instance.
|
|
@@ -391,13 +400,13 @@ class Bot:
|
|
|
391
400
|
ws_max_retries=ws_max_retries,
|
|
392
401
|
debug=debug,
|
|
393
402
|
on_health_check=on_health_check,
|
|
403
|
+
timeout=timeout,
|
|
394
404
|
)
|
|
395
405
|
|
|
396
406
|
async def __wait_upload_complete(
|
|
397
407
|
self,
|
|
398
408
|
file_id: str,
|
|
399
|
-
expected_size: int
|
|
400
|
-
timeout: float | None = None,
|
|
409
|
+
expected_size: int
|
|
401
410
|
) -> bool:
|
|
402
411
|
q = self._progress_queues.get(file_id)
|
|
403
412
|
if q is None:
|
|
@@ -407,11 +416,7 @@ class Bot:
|
|
|
407
416
|
await self.subscribe_file_progress(file_id)
|
|
408
417
|
try:
|
|
409
418
|
while True:
|
|
410
|
-
|
|
411
|
-
update = await q.get()
|
|
412
|
-
else:
|
|
413
|
-
update = await asyncio.wait_for(q.get(), timeout=timeout)
|
|
414
|
-
|
|
419
|
+
update = await asyncio.wait_for(q.get(), timeout=self.timeout)
|
|
415
420
|
if update.progress >= expected_size:
|
|
416
421
|
return True
|
|
417
422
|
except asyncio.TimeoutError:
|
|
@@ -426,8 +431,6 @@ class Bot:
|
|
|
426
431
|
url: str,
|
|
427
432
|
file_name: str,
|
|
428
433
|
dest_path: str | Path | None = None,
|
|
429
|
-
timeout: int = 60,
|
|
430
|
-
chunk_size: int = 64 * 1024,
|
|
431
434
|
) -> bytes | Path | None:
|
|
432
435
|
|
|
433
436
|
"""
|
|
@@ -438,8 +441,6 @@ class Bot:
|
|
|
438
441
|
file_name (str): Name of the file to be saved.
|
|
439
442
|
dest_path (str | Path | None): Destination path on disk.
|
|
440
443
|
If None, the file will be downloaded into memory. Defaults to None.
|
|
441
|
-
timeout (int): Request timeout in seconds. Defaults to 60.
|
|
442
|
-
chunk_size (int): Stream chunk size in bytes. Defaults to 65536 (64 KB).
|
|
443
444
|
|
|
444
445
|
Returns:
|
|
445
446
|
bytes | Path | None:
|
|
@@ -452,13 +453,13 @@ class Bot:
|
|
|
452
453
|
if dest_path:
|
|
453
454
|
loggers.chatbot.info(f"⬇️ Destination: {dest_path}")
|
|
454
455
|
try:
|
|
455
|
-
async with httpx.AsyncClient(verify=self.ssl_context, timeout=httpx.Timeout(timeout)) as client:
|
|
456
|
+
async with httpx.AsyncClient(verify=self.ssl_context, timeout=httpx.Timeout(self.timeout)) as client:
|
|
456
457
|
async with client.stream("GET", url) as resp:
|
|
457
458
|
resp.raise_for_status()
|
|
458
459
|
|
|
459
460
|
if dest_path is None:
|
|
460
461
|
chunks = []
|
|
461
|
-
async for chunk in resp.aiter_bytes(
|
|
462
|
+
async for chunk in resp.aiter_bytes():
|
|
462
463
|
chunks.append(chunk)
|
|
463
464
|
result_data = b"".join(chunks)
|
|
464
465
|
loggers.chatbot.info(f"⬇️ Downloaded {len(result_data)} bytes into memory")
|
|
@@ -468,7 +469,7 @@ class Bot:
|
|
|
468
469
|
dest.parent.mkdir(parents=True, exist_ok=True)
|
|
469
470
|
|
|
470
471
|
async with aiofiles.open(dest, "wb") as f:
|
|
471
|
-
async for chunk in resp.aiter_bytes(
|
|
472
|
+
async for chunk in resp.aiter_bytes():
|
|
472
473
|
await f.write(chunk)
|
|
473
474
|
loggers.chatbot.info(f"⬇️ File saved to: {dest}")
|
|
474
475
|
return dest
|
|
@@ -484,7 +485,6 @@ class Bot:
|
|
|
484
485
|
file: InputFile,
|
|
485
486
|
preview: InputFile | None = None,
|
|
486
487
|
is_sticker: bool = False,
|
|
487
|
-
timeout: float = 60.0,
|
|
488
488
|
) -> str:
|
|
489
489
|
"""
|
|
490
490
|
Uploads a file to the server and returns a temporary file identifier (temporalFileId).
|
|
@@ -507,7 +507,6 @@ class Bot:
|
|
|
507
507
|
file (InputFile): The primary file to upload.
|
|
508
508
|
preview (InputFile | None, optional): Optional preview file (default is None).
|
|
509
509
|
is_sticker (bool, optional): Whether the uploaded file is a sticker (affects MIME type). Defaults to False.
|
|
510
|
-
timeout (float, optional): Upload timeout in seconds. Defaults to 60.
|
|
511
510
|
|
|
512
511
|
Returns:
|
|
513
512
|
str | None: A temporary file ID (`temporalFileId`) on success, or None if the upload failed.
|
|
@@ -529,8 +528,15 @@ class Bot:
|
|
|
529
528
|
|
|
530
529
|
connector = TCPConnector(ssl=self.ssl_context)
|
|
531
530
|
|
|
531
|
+
timeout = ClientTimeout(
|
|
532
|
+
total=None,
|
|
533
|
+
connect=min(10.0, self.timeout),
|
|
534
|
+
sock_connect=min(10.0, self.timeout),
|
|
535
|
+
sock_read=self.timeout
|
|
536
|
+
)
|
|
537
|
+
|
|
532
538
|
try:
|
|
533
|
-
async with ClientSession(connector=connector, timeout=
|
|
539
|
+
async with ClientSession(connector=connector, timeout=timeout) as session:
|
|
534
540
|
data = FormData(quote_fields=False)
|
|
535
541
|
data.add_field(
|
|
536
542
|
name="file",
|
|
@@ -1107,7 +1113,7 @@ class Bot:
|
|
|
1107
1113
|
|
|
1108
1114
|
if info.ready_state != FileReadyState.READY:
|
|
1109
1115
|
loggers.chatbot.info(f"📥 File {file_id} not ready yet, waiting for upload ({info.size} bytes)")
|
|
1110
|
-
ok = await self.__wait_upload_complete(file_id, expected_size=info.size
|
|
1116
|
+
ok = await self.__wait_upload_complete(file_id, expected_size=info.size)
|
|
1111
1117
|
if not ok:
|
|
1112
1118
|
loggers.chatbot.error(f"Wait upload complete failed for {file_id}")
|
|
1113
1119
|
return None
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
from trueconf.fsm.manager import FSMManager
|
|
6
|
+
from trueconf.middleware import BaseMiddleware
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class FSMMiddleware(BaseMiddleware):
|
|
10
|
+
def __init__(self, fsm_manager: FSMManager) -> None:
|
|
11
|
+
self._manager = fsm_manager
|
|
12
|
+
|
|
13
|
+
async def __call__(
|
|
14
|
+
self,
|
|
15
|
+
handler: Any,
|
|
16
|
+
event: Any,
|
|
17
|
+
data: dict[str, Any],
|
|
18
|
+
) -> None:
|
|
19
|
+
bot = data.get("bot")
|
|
20
|
+
if bot is not None:
|
|
21
|
+
chat_id = (
|
|
22
|
+
getattr(event, "chat_id", None)
|
|
23
|
+
or getattr(getattr(event, "chat", None), "id", None)
|
|
24
|
+
)
|
|
25
|
+
user = getattr(event, "from_user", None) or getattr(event, "author", None)
|
|
26
|
+
user_id = getattr(user, "id", None) if user else None
|
|
27
|
+
|
|
28
|
+
if chat_id is not None and user_id is not None:
|
|
29
|
+
context = self._manager.get_context(bot, event)
|
|
30
|
+
data["state"] = context
|
|
31
|
+
data["raw_state"] = await context.get_state()
|
|
32
|
+
|
|
33
|
+
return await handler(event, data)
|
|
@@ -70,7 +70,7 @@ class TrueConfMethod(ABC, Generic[T]):
|
|
|
70
70
|
|
|
71
71
|
return ret(**payload) # type: ignore[misc]
|
|
72
72
|
|
|
73
|
-
async def __call__(self, bot: "Bot", timeout: float = 10.0) -> T:
|
|
73
|
+
async def __call__(self, bot: "Bot", timeout: float | int = 10.0) -> T:
|
|
74
74
|
loop = get_running_loop()
|
|
75
75
|
future = loop.create_future()
|
|
76
76
|
bot._register_future(self.id, future)
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import Any
|
|
4
|
-
|
|
5
|
-
from trueconf.fsm.manager import FSMManager
|
|
6
|
-
from trueconf.middleware import BaseMiddleware
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class FSMMiddleware(BaseMiddleware):
|
|
10
|
-
def __init__(self, fsm_manager: FSMManager) -> None:
|
|
11
|
-
self._manager = fsm_manager
|
|
12
|
-
|
|
13
|
-
async def __call__(
|
|
14
|
-
self,
|
|
15
|
-
handler: Any,
|
|
16
|
-
event: Any,
|
|
17
|
-
data: dict[str, Any],
|
|
18
|
-
) -> None:
|
|
19
|
-
bot = data.get("bot")
|
|
20
|
-
if bot is not None:
|
|
21
|
-
context = self._manager.get_context(bot, event)
|
|
22
|
-
data["state"] = context
|
|
23
|
-
data["raw_state"] = await context.get_state()
|
|
24
|
-
return await handler(event, data)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/examples/add_big_list_users_to_channel.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/python_trueconf_bot.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/python_trueconf_bot.egg-info/requires.txt
RENAMED
|
File without changes
|
{python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/python_trueconf_bot.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/client/context_controller.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/enums/chat_participant_role.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/enums/envelope_author_type.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_trueconf_bot-1.4.0 → python_trueconf_bot-1.4.1}/trueconf/enums/incoming_update_method.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|