python-trueconf-bot 1.1.9__tar.gz → 1.2.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.
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/.gitignore +2 -1
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/PKG-INFO +4 -3
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/index.md +5 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/learn/files.md +46 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/learn/filters.md +82 -0
- python_trueconf_bot-1.2.0/docs/hooks/llms_txt.py +573 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/ru/index.md +4 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/ru/learn/files.md +45 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/ru/learn/filters.md +86 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/mkdocs.yml +9 -1
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/pyproject.toml +3 -4
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/python_trueconf_bot.egg-info/PKG-INFO +4 -3
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/python_trueconf_bot.egg-info/SOURCES.txt +16 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/python_trueconf_bot.egg-info/requires.txt +5 -1
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/_version.py +3 -3
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/client/bot.py +420 -130
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/dispatcher/router.py +135 -2
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/enums/incoming_update_method.py +4 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/enums/message_type.py +4 -0
- python_trueconf_bot-1.2.0/trueconf/exceptions.py +113 -0
- python_trueconf_bot-1.2.0/trueconf/loggers.py +19 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/__init__.py +2 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/auth.py +3 -2
- python_trueconf_bot-1.2.0/trueconf/methods/clear_chat_history.py +22 -0
- python_trueconf_bot-1.2.0/trueconf/methods/edit_chat_avatar.py +22 -0
- python_trueconf_bot-1.2.0/trueconf/methods/edit_chat_title.py +22 -0
- python_trueconf_bot-1.2.0/trueconf/methods/get_file_upload_limits.py +16 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/remove_participant_from_chat.py +3 -1
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/send_file.py +13 -7
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/upload_file.py +2 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/__init__.py +4 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/content/base.py +0 -1
- python_trueconf_bot-1.2.0/trueconf/types/content/edit_chat_title.py +8 -0
- python_trueconf_bot-1.2.0/trueconf/types/content/location.py +10 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/input_file.py +185 -87
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/last_message.py +12 -1
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/message.py +11 -1
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/parser.py +30 -7
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/requests/__init__.py +4 -0
- python_trueconf_bot-1.2.0/trueconf/types/requests/changed_file_upload_limits.py +19 -0
- python_trueconf_bot-1.2.0/trueconf/types/requests/cleared_chat_history.py +9 -0
- python_trueconf_bot-1.2.0/trueconf/types/requests/edited_chat_avatar.py +9 -0
- python_trueconf_bot-1.2.0/trueconf/types/requests/edited_chat_title.py +9 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/__init__.py +46 -42
- python_trueconf_bot-1.2.0/trueconf/types/responses/clear_chat_history_response.py +8 -0
- python_trueconf_bot-1.2.0/trueconf/types/responses/edit_chat_avatar_response.py +8 -0
- python_trueconf_bot-1.2.0/trueconf/types/responses/edit_chat_title_response.py +9 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/get_chat_by_id_response.py +1 -0
- python_trueconf_bot-1.2.0/trueconf/types/responses/get_file_upload_limits_response.py +16 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/send_file_response.py +1 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/utils/__init__.py +1 -0
- python_trueconf_bot-1.2.0/trueconf/utils/split_text.py +603 -0
- python_trueconf_bot-1.1.9/trueconf/exceptions.py +0 -21
- python_trueconf_bot-1.1.9/trueconf/loggers.py +0 -4
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/.github/workflows/docs.yml +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/.github/workflows/release-test.yml +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/.github/workflows/release.yml +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/LICENSE +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/README-PyPI.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/README-ru.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/README.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/assets/head_en.png +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/assets/head_ru.png +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/assets/logo.svg +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/examples/echo_bot.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/examples/multibot.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/features.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/img/head.png +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/img/router_scheme_en.svg +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/learn/enums.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/learn/getting-started.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/learn/parse-messages.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/learn/types.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/reference/Bot.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/reference/Dispatcher.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/reference/Enums.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/reference/Responses.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/reference/Router.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/reference/Types.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/reference/index.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/en/release_notes.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/img/chatbot.svg +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/img/favicon.ico +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/img/logo.svg +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/overrides/main.html +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/ru/examples/echo_bot.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/ru/examples/multibot.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/ru/features.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/ru/img/head.png +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/ru/img/router_scheme_ru.svg +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/ru/learn/enums.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/ru/learn/getting-started.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/ru/learn/parse-messages.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/ru/learn/types.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/ru/release_notes.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/docs/stylesheets/extra.css +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/examples/README-ru.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/examples/README.md +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/examples/add_big_list_users_to_channel.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/examples/filters.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/examples/report_bot.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/examples/update_token.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/examples/webhook.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/python_trueconf_bot.egg-info/dependency_links.txt +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/python_trueconf_bot.egg-info/top_level.txt +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/requirements-docs.txt +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/requirements.txt +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/setup.cfg +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/__init__.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/client/__init__.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/client/context_controller.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/client/session.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/dispatcher/__init__.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/dispatcher/dispatcher.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/enums/__init__.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/enums/aouth_error.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/enums/chat_participant_role.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/enums/chat_type.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/enums/envelope_author_type.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/enums/file_ready_state.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/enums/parse_mode.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/enums/survey_type.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/enums/update_type.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/filters/__init__.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/filters/base.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/filters/command.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/filters/instance_of.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/filters/message.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/filters/method.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/add_participant_to_chat.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/base.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/change_participant_role.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/create_channel.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/create_favorites_chat.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/create_group_chat.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/create_p2p_chat.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/edit_message.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/edit_survey.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/forward_message.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/get_chat_by_id.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/get_chat_history.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/get_chat_participants.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/get_chats.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/get_file_info.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/get_message_by_id.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/get_user_display_name.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/has_chat_participant.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/remove_chat.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/remove_message.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/send_message.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/send_survey.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/subscribe_file_progress.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/methods/unsubscribe_file_progress.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/py.typed +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/author_box.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/chat_participant.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/content/__init__.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/content/attachment.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/content/chat_created.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/content/document.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/content/forward_message.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/content/photo.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/content/remove_participant.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/content/sticker.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/content/survey.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/content/text.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/content/video.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/requests/added_chat_participant.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/requests/changed_participant_role.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/requests/created_channel.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/requests/created_favorites_chat.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/requests/created_group_chat.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/requests/created_personal_chat.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/requests/edited_message.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/requests/removed_chat.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/requests/removed_chat_participant.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/requests/removed_message.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/requests/uploading_progress.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/add_chat_participant_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/api_error.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/auth_response_payload.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/change_participant_role_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/create_channel_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/create_favorites_chat_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/create_group_chat_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/create_p2p_chat_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/edit_message_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/edit_survey_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/forward_message_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/get_chat_history_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/get_chat_participants_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/get_chats_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/get_file_info_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/get_message_by_id_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/get_user_display_name_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/has_chat_participant_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/remove_chat_participant_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/remove_chat_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/remove_message_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/send_message_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/send_survey_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/subscribe_file_progress_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/unsubscribe_file_progress_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/responses/upload_file_response.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/types/update.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/utils/generate_secret_for_survey.py +0 -0
- {python_trueconf_bot-1.1.9 → python_trueconf_bot-1.2.0}/trueconf/utils/token.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-trueconf-bot
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
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
|
|
@@ -31,8 +31,9 @@ Requires-Dist: magic-filter
|
|
|
31
31
|
Requires-Dist: aiohttp
|
|
32
32
|
Requires-Dist: async-property
|
|
33
33
|
Requires-Dist: typing_extensions>=4.15.0
|
|
34
|
-
|
|
35
|
-
Requires-Dist: python-magic
|
|
34
|
+
Requires-Dist: python-magic>=0.4.27; sys_platform != "win32"
|
|
35
|
+
Requires-Dist: python-magic-bin==0.4.14; sys_platform == "win32"
|
|
36
|
+
Requires-Dist: filetype
|
|
36
37
|
Dynamic: license-file
|
|
37
38
|
|
|
38
39
|
<p align="center">
|
|
@@ -41,3 +41,8 @@ pip install {{product_name}}
|
|
|
41
41
|
| JSON → Python | Pydantic models | Mashumaro dataclasses |
|
|
42
42
|
| Transport | HTTPS + long polling / webhook | Asynchronous WebSocket |
|
|
43
43
|
| Working with files | `bot.get_file(...)` + `bot.download_file(...)` | `message.photo.download()`, `message.document.download()`, `bot.download_file_by_id(...)` |
|
|
44
|
+
|
|
45
|
+
## LLM Files
|
|
46
|
+
|
|
47
|
+
- [llms.txt](https://trueconf.github.io/python-trueconf-bot/master/llms.txt)
|
|
48
|
+
- [llms-full.txt](https://trueconf.github.io/python-trueconf-bot/master/llms-full.txt)
|
|
@@ -141,3 +141,49 @@ await bot.download_file_by_id(
|
|
|
141
141
|
dest_path="document.pdf"
|
|
142
142
|
)
|
|
143
143
|
```
|
|
144
|
+
|
|
145
|
+
## MIME Type Detection with python-magic
|
|
146
|
+
|
|
147
|
+
A file’s MIME type can be detected automatically. The library supports two approaches:
|
|
148
|
+
|
|
149
|
+
* **By file extension** — works without additional dependencies, but may be inaccurate.
|
|
150
|
+
* **By file content (bytes)** — significantly more accurate, but requires `python-magic`.
|
|
151
|
+
|
|
152
|
+
### How It Works
|
|
153
|
+
|
|
154
|
+
The `python-magic` package does not determine MIME types on its own. It is a Python wrapper around the native **libmagic** library written in C, which is what actually identifies a file type based on its contents.
|
|
155
|
+
|
|
156
|
+
That is why `python-magic` may not work out of the box on some systems: the Python package is installed via `pip`, but the system library `libmagic` must be installed separately.
|
|
157
|
+
|
|
158
|
+
If `libmagic` is missing, importing `magic` may fail with an error such as:
|
|
159
|
+
|
|
160
|
+
* `ImportError: failed to find libmagic. Check your installation`
|
|
161
|
+
|
|
162
|
+
### Installation
|
|
163
|
+
|
|
164
|
+
Install the system dependencies:
|
|
165
|
+
|
|
166
|
+
* **macOS (Homebrew):**
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
brew install libmagic
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
* **Linux (Debian/Ubuntu):**
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
sudo apt install libmagic1
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
* **Windows:**
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
pip install python-magic-bin
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
We also recommend reviewing the repository: [https://github.com/ahupp/python-magic](https://github.com/ahupp/python-magic).
|
|
185
|
+
|
|
186
|
+
### Notes
|
|
187
|
+
|
|
188
|
+
* When `python-magic` is available, the MIME type is detected **from the file bytes**, which is usually more accurate than detecting it by filename or extension.
|
|
189
|
+
|
|
@@ -215,8 +215,90 @@ F.text.upper().in_({"FOO", "BAR"}) # message.text.upper() in {"FOO", "BAR"}
|
|
|
215
215
|
F.text.len() == 5 # len(message.text) == 5
|
|
216
216
|
```
|
|
217
217
|
|
|
218
|
+
## Building Custom Filters
|
|
219
|
+
|
|
220
|
+
You can build custom filters to fine-tune your event-handling logic. This allows you to move condition checks—such as verifying whether a user exists in the database or checking access permissions—into a separate, reusable component.
|
|
221
|
+
|
|
222
|
+
**Implementation requirements:**
|
|
223
|
+
|
|
224
|
+
* **Class-based structure:** A custom filter must be implemented as a class. This makes it possible to preserve state, such as filter settings, when the filter is initialized.
|
|
225
|
+
* **`__call__` method:** The class must implement a `__call__` method. Without it, the class instance will not be considered callable, and the filter will not work.
|
|
226
|
+
* **Return value:** The `__call__` method must return `True` if the event matches the filter conditions, or `False` if the event should be ignored by the handler.
|
|
227
|
+
|
|
228
|
+
```python
|
|
229
|
+
from typing import Any
|
|
230
|
+
|
|
231
|
+
class MyFilter:
|
|
232
|
+
"""
|
|
233
|
+
This filter checks whether a user belongs
|
|
234
|
+
to the specified group via the server API.
|
|
235
|
+
"""
|
|
236
|
+
|
|
237
|
+
def __init__(self, target_group: str):
|
|
238
|
+
# Store the required group when creating the instance
|
|
239
|
+
self.target_group = target_group
|
|
240
|
+
|
|
241
|
+
async def __call__(self, event: Any) -> bool:
|
|
242
|
+
user = getattr(event, "from_user", None)
|
|
243
|
+
if not user:
|
|
244
|
+
return False
|
|
245
|
+
|
|
246
|
+
user_id = user.id
|
|
247
|
+
# Perform the check, for example via an API call
|
|
248
|
+
user_info: dict = await server_api.get_user(user_id)
|
|
249
|
+
groups = user_info.get("groups", [])
|
|
250
|
+
|
|
251
|
+
# Make sure to return True or False
|
|
252
|
+
return any(group.get("id") == self.target_group for group in groups)
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Once the filter class is defined, you can use it in handler decorators exactly the same way as the built-in **Command** or **F** filters. When registering a handler, simply pass an instance of your class as an argument.
|
|
256
|
+
|
|
257
|
+
```python hl_lines="8"
|
|
258
|
+
from aiogram import Router, Message
|
|
259
|
+
# Import your filter class
|
|
260
|
+
from my_filters import MyFilter
|
|
261
|
+
|
|
262
|
+
router = Router()
|
|
263
|
+
|
|
264
|
+
# Attach the filter in the same way as Command or F
|
|
265
|
+
@router.message(MyFilter(target_group="0032"))
|
|
266
|
+
async def my_handler(message: Message):
|
|
267
|
+
await message.answer("Access granted: you belong to the required group!")
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
When a message is received, the bot will use the class instance, call its `__call__` method, and, if it returns `True`, execute the handler code.
|
|
271
|
+
|
|
218
272
|
## Combining Filters
|
|
219
273
|
|
|
274
|
+
In **python-trueconf-bot**, you can combine multiple filters within a single handler. By default, when filters are separated by commas, they use **AND** logic—the handler will run only if **all** filters return `True`.
|
|
275
|
+
|
|
276
|
+
**Command and a custom filter**
|
|
277
|
+
|
|
278
|
+
You can restrict access to a specific command by using your own filter. The handler will run only if the message is the specified command **and** your filter returns `True`.
|
|
279
|
+
|
|
280
|
+
```python
|
|
281
|
+
# Triggers if the /admin command is received
|
|
282
|
+
# AND the user belongs to group "0032"
|
|
283
|
+
@r.message(Command("admin"), InGroupFilter(target_group="0032"))
|
|
284
|
+
async def admin_panel(message: Message):
|
|
285
|
+
await message.answer("Welcome to the admin panel!")
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
**MagicFilter (F) and a custom filter**
|
|
289
|
+
|
|
290
|
+
Combine message-content checks with your own access rules. For example, you can react to a specific word in the text only for users from certain groups:
|
|
291
|
+
|
|
292
|
+
```python
|
|
293
|
+
# Triggers if the text contains "help"
|
|
294
|
+
# AND the user belongs to the "support" group
|
|
295
|
+
@r.message(F.text.contains("help"), InGroupFilter(target_group="0003"))
|
|
296
|
+
async def support_handler(message: Message):
|
|
297
|
+
await message.answer("The support team has been notified of your request.")
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### Combining Command Arguments and MagicFilter
|
|
301
|
+
|
|
220
302
|
Combining **Command** and **MagicFilter** is a common and recommended practice:
|
|
221
303
|
**Command** parses the command and creates a **CommandObject**, while `magic`
|
|
222
304
|
allows you to impose additional conditions on `args` or other parts of the
|