python-trueconf-bot 1.1.7__tar.gz → 1.2.0b1__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.7 → python_trueconf_bot-1.2.0b1}/.gitignore +2 -1
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/PKG-INFO +3 -3
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/ru/learn/files.md +45 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/pyproject.toml +2 -4
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/python_trueconf_bot.egg-info/PKG-INFO +3 -3
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/python_trueconf_bot.egg-info/SOURCES.txt +7 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/python_trueconf_bot.egg-info/requires.txt +4 -1
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/_version.py +3 -3
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/client/bot.py +99 -24
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/dispatcher/router.py +2 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/enums/incoming_update_method.py +2 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/enums/message_type.py +4 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/__init__.py +2 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/auth.py +3 -2
- python_trueconf_bot-1.2.0b1/trueconf/methods/edit_chat_title.py +22 -0
- python_trueconf_bot-1.2.0b1/trueconf/methods/get_file_upload_limits.py +16 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/upload_file.py +2 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/__init__.py +4 -0
- python_trueconf_bot-1.2.0b1/trueconf/types/content/location.py +10 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/input_file.py +172 -87
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/message.py +9 -1
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/parser.py +22 -7
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/requests/__init__.py +4 -0
- python_trueconf_bot-1.2.0b1/trueconf/types/requests/changed_file_upload_limits.py +18 -0
- python_trueconf_bot-1.2.0b1/trueconf/types/requests/edited_chat_title.py +9 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/__init__.py +46 -42
- python_trueconf_bot-1.2.0b1/trueconf/types/responses/edit_chat_title_response.py +9 -0
- python_trueconf_bot-1.2.0b1/trueconf/types/responses/get_file_upload_limits_response.py +16 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/.github/workflows/docs.yml +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/.github/workflows/release-test.yml +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/.github/workflows/release.yml +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/LICENSE +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/README-PyPI.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/README-ru.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/README.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/assets/head_en.png +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/assets/head_ru.png +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/assets/logo.svg +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/examples/echo_bot.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/examples/multibot.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/features.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/img/head.png +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/img/router_scheme_en.svg +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/index.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/learn/enums.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/learn/files.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/learn/filters.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/learn/getting-started.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/learn/parse-messages.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/learn/types.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/reference/Bot.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/reference/Dispatcher.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/reference/Enums.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/reference/Responses.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/reference/Router.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/reference/Types.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/reference/index.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/en/release_notes.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/img/chatbot.svg +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/img/favicon.ico +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/img/logo.svg +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/overrides/main.html +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/ru/examples/echo_bot.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/ru/examples/multibot.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/ru/features.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/ru/img/head.png +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/ru/img/router_scheme_ru.svg +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/ru/index.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/ru/learn/enums.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/ru/learn/filters.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/ru/learn/getting-started.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/ru/learn/parse-messages.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/ru/learn/types.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/ru/release_notes.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/docs/stylesheets/extra.css +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/examples/README-ru.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/examples/README.md +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/examples/add_big_list_users_to_channel.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/examples/filters.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/examples/report_bot.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/examples/update_token.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/examples/webhook.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/mkdocs.yml +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/python_trueconf_bot.egg-info/dependency_links.txt +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/python_trueconf_bot.egg-info/top_level.txt +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/requirements-docs.txt +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/requirements.txt +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/setup.cfg +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/__init__.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/client/__init__.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/client/context_controller.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/client/session.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/dispatcher/__init__.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/dispatcher/dispatcher.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/enums/__init__.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/enums/aouth_error.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/enums/chat_participant_role.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/enums/chat_type.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/enums/envelope_author_type.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/enums/file_ready_state.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/enums/parse_mode.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/enums/survey_type.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/enums/update_type.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/exceptions.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/filters/__init__.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/filters/base.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/filters/command.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/filters/instance_of.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/filters/message.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/filters/method.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/loggers.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/add_participant_to_chat.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/base.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/change_participant_role.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/create_channel.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/create_favorites_chat.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/create_group_chat.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/create_p2p_chat.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/edit_message.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/edit_survey.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/forward_message.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/get_chat_by_id.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/get_chat_history.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/get_chat_participants.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/get_chats.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/get_file_info.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/get_message_by_id.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/get_user_display_name.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/has_chat_participant.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/remove_chat.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/remove_message.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/remove_participant_from_chat.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/send_file.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/send_message.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/send_survey.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/subscribe_file_progress.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/methods/unsubscribe_file_progress.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/py.typed +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/author_box.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/chat_participant.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/content/__init__.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/content/attachment.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/content/base.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/content/chat_created.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/content/document.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/content/forward_message.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/content/photo.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/content/remove_participant.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/content/sticker.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/content/survey.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/content/text.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/content/video.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/last_message.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/requests/added_chat_participant.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/requests/changed_participant_role.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/requests/created_channel.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/requests/created_favorites_chat.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/requests/created_group_chat.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/requests/created_personal_chat.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/requests/edited_message.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/requests/removed_chat.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/requests/removed_chat_participant.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/requests/removed_message.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/requests/uploading_progress.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/add_chat_participant_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/api_error.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/auth_response_payload.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/change_participant_role_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/create_channel_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/create_favorites_chat_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/create_group_chat_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/create_p2p_chat_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/edit_message_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/edit_survey_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/forward_message_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/get_chat_by_id_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/get_chat_history_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/get_chat_participants_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/get_chats_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/get_file_info_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/get_message_by_id_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/get_user_display_name_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/has_chat_participant_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/remove_chat_participant_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/remove_chat_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/remove_message_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/send_file_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/send_message_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/send_survey_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/subscribe_file_progress_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/unsubscribe_file_progress_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/responses/upload_file_response.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/types/update.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/utils/__init__.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/utils/generate_secret_for_survey.py +0 -0
- {python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/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.0b1
|
|
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,8 @@ 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>=0.4.27;
|
|
34
|
+
Requires-Dist: python-magic>=0.4.27; sys_platform != "win32"
|
|
35
|
+
Requires-Dist: python-magic-bin>=0.4.27; sys_platform == "win32"
|
|
36
36
|
Dynamic: license-file
|
|
37
37
|
|
|
38
38
|
<p align="center">
|
|
@@ -133,6 +133,51 @@ await bot.download_file_by_id(
|
|
|
133
133
|
)
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
+
## Определение MIME-типа с помощью python-magic
|
|
137
|
+
|
|
138
|
+
MIME‑тип файла может определяться автоматически. В библиотеке поддерживаются два подхода:
|
|
139
|
+
|
|
140
|
+
* **По расширению файла** — работает без дополнительных зависимостей, но может быть неточным.
|
|
141
|
+
* **По содержимому файла (bytes)** — заметно точнее, но требует `python-magic`.
|
|
142
|
+
|
|
143
|
+
### Как это работает
|
|
144
|
+
|
|
145
|
+
Пакет `python-magic` сам по себе MIME‑типы не определяет. Это Python‑обёртка над нативной (C‑шной) библиотекой **libmagic**, которая и выполняет распознавание типа файла по содержимому.
|
|
146
|
+
|
|
147
|
+
Именно поэтому `python-magic` может не работать «из коробки» на некоторых системах: Python‑пакет устанавливается через `pip`, но системная библиотека `libmagic` должна быть установлена отдельно.
|
|
148
|
+
|
|
149
|
+
Если `libmagic` отсутствует, импорт `magic` может завершиться ошибкой вида:
|
|
150
|
+
|
|
151
|
+
* `ImportError: failed to find libmagic. Check your installation`
|
|
152
|
+
|
|
153
|
+
### Установка
|
|
154
|
+
|
|
155
|
+
Установите системные зависимости:
|
|
156
|
+
|
|
157
|
+
* **macOS (Homebrew):**
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
brew install libmagic
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
* **Linux (Debian/Ubuntu):**
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
sudo apt install libmagic1
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
* **Windows:**
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
pip install python-magic-bin
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Также рекомендуем ознакомиться с репозиторием [https://github.com/ahupp/python-magic](https://github.com/ahupp/python-magic).
|
|
176
|
+
|
|
177
|
+
### Примечания
|
|
178
|
+
|
|
179
|
+
* При наличии `python-magic` MIME‑тип определяется **по байтам файла**, что обычно точнее, чем определение по имени или расширению.
|
|
180
|
+
|
|
136
181
|
|
|
137
182
|
|
|
138
183
|
|
|
@@ -49,12 +49,10 @@ dependencies = [
|
|
|
49
49
|
"aiohttp",
|
|
50
50
|
"async-property",
|
|
51
51
|
"typing_extensions>=4.15.0",
|
|
52
|
+
"python-magic>=0.4.27 ; sys_platform != 'win32'",
|
|
53
|
+
"python-magic-bin>=0.4.27 ; sys_platform == 'win32'",
|
|
52
54
|
]
|
|
53
55
|
|
|
54
|
-
[project.optional-dependencies]
|
|
55
|
-
python-magic = ["python-magic>=0.4.27"]
|
|
56
|
-
|
|
57
|
-
|
|
58
56
|
[tool.setuptools]
|
|
59
57
|
packages = ["trueconf"]
|
|
60
58
|
|
{python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/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.
|
|
3
|
+
Version: 1.2.0b1
|
|
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,8 @@ 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>=0.4.27;
|
|
34
|
+
Requires-Dist: python-magic>=0.4.27; sys_platform != "win32"
|
|
35
|
+
Requires-Dist: python-magic-bin>=0.4.27; sys_platform == "win32"
|
|
36
36
|
Dynamic: license-file
|
|
37
37
|
|
|
38
38
|
<p align="center">
|
{python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/python_trueconf_bot.egg-info/SOURCES.txt
RENAMED
|
@@ -101,6 +101,7 @@ trueconf/methods/create_channel.py
|
|
|
101
101
|
trueconf/methods/create_favorites_chat.py
|
|
102
102
|
trueconf/methods/create_group_chat.py
|
|
103
103
|
trueconf/methods/create_p2p_chat.py
|
|
104
|
+
trueconf/methods/edit_chat_title.py
|
|
104
105
|
trueconf/methods/edit_message.py
|
|
105
106
|
trueconf/methods/edit_survey.py
|
|
106
107
|
trueconf/methods/forward_message.py
|
|
@@ -109,6 +110,7 @@ trueconf/methods/get_chat_history.py
|
|
|
109
110
|
trueconf/methods/get_chat_participants.py
|
|
110
111
|
trueconf/methods/get_chats.py
|
|
111
112
|
trueconf/methods/get_file_info.py
|
|
113
|
+
trueconf/methods/get_file_upload_limits.py
|
|
112
114
|
trueconf/methods/get_message_by_id.py
|
|
113
115
|
trueconf/methods/get_user_display_name.py
|
|
114
116
|
trueconf/methods/has_chat_participant.py
|
|
@@ -135,6 +137,7 @@ trueconf/types/content/base.py
|
|
|
135
137
|
trueconf/types/content/chat_created.py
|
|
136
138
|
trueconf/types/content/document.py
|
|
137
139
|
trueconf/types/content/forward_message.py
|
|
140
|
+
trueconf/types/content/location.py
|
|
138
141
|
trueconf/types/content/photo.py
|
|
139
142
|
trueconf/types/content/remove_participant.py
|
|
140
143
|
trueconf/types/content/sticker.py
|
|
@@ -143,11 +146,13 @@ trueconf/types/content/text.py
|
|
|
143
146
|
trueconf/types/content/video.py
|
|
144
147
|
trueconf/types/requests/__init__.py
|
|
145
148
|
trueconf/types/requests/added_chat_participant.py
|
|
149
|
+
trueconf/types/requests/changed_file_upload_limits.py
|
|
146
150
|
trueconf/types/requests/changed_participant_role.py
|
|
147
151
|
trueconf/types/requests/created_channel.py
|
|
148
152
|
trueconf/types/requests/created_favorites_chat.py
|
|
149
153
|
trueconf/types/requests/created_group_chat.py
|
|
150
154
|
trueconf/types/requests/created_personal_chat.py
|
|
155
|
+
trueconf/types/requests/edited_chat_title.py
|
|
151
156
|
trueconf/types/requests/edited_message.py
|
|
152
157
|
trueconf/types/requests/removed_chat.py
|
|
153
158
|
trueconf/types/requests/removed_chat_participant.py
|
|
@@ -162,6 +167,7 @@ trueconf/types/responses/create_channel_response.py
|
|
|
162
167
|
trueconf/types/responses/create_favorites_chat_response.py
|
|
163
168
|
trueconf/types/responses/create_group_chat_response.py
|
|
164
169
|
trueconf/types/responses/create_p2p_chat_response.py
|
|
170
|
+
trueconf/types/responses/edit_chat_title_response.py
|
|
165
171
|
trueconf/types/responses/edit_message_response.py
|
|
166
172
|
trueconf/types/responses/edit_survey_response.py
|
|
167
173
|
trueconf/types/responses/forward_message_response.py
|
|
@@ -170,6 +176,7 @@ trueconf/types/responses/get_chat_history_response.py
|
|
|
170
176
|
trueconf/types/responses/get_chat_participants_response.py
|
|
171
177
|
trueconf/types/responses/get_chats_response.py
|
|
172
178
|
trueconf/types/responses/get_file_info_response.py
|
|
179
|
+
trueconf/types/responses/get_file_upload_limits_response.py
|
|
173
180
|
trueconf/types/responses/get_message_by_id_response.py
|
|
174
181
|
trueconf/types/responses/get_user_display_name_response.py
|
|
175
182
|
trueconf/types/responses/has_chat_participant_response.py
|
|
@@ -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.
|
|
22
|
-
__version_tuple__ = version_tuple = (1,
|
|
21
|
+
__version__ = version = '1.2.0b1'
|
|
22
|
+
__version_tuple__ = version_tuple = (1, 2, 0, 'b1')
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'gdc2498caa'
|
|
@@ -39,6 +39,7 @@ from trueconf.methods.create_channel import CreateChannel
|
|
|
39
39
|
from trueconf.methods.create_favorites_chat import CreateFavoritesChat
|
|
40
40
|
from trueconf.methods.create_group_chat import CreateGroupChat
|
|
41
41
|
from trueconf.methods.create_p2p_chat import CreateP2PChat
|
|
42
|
+
from trueconf.methods.edit_chat_title import EditChatTitle
|
|
42
43
|
from trueconf.methods.edit_message import EditMessage
|
|
43
44
|
from trueconf.methods.edit_survey import EditSurvey
|
|
44
45
|
from trueconf.methods.forward_message import ForwardMessage
|
|
@@ -47,6 +48,7 @@ from trueconf.methods.get_chat_history import GetChatHistory
|
|
|
47
48
|
from trueconf.methods.get_chat_participants import GetChatParticipants
|
|
48
49
|
from trueconf.methods.get_chats import GetChats
|
|
49
50
|
from trueconf.methods.get_file_info import GetFileInfo
|
|
51
|
+
from trueconf.methods.get_file_upload_limits import GetFileUploadLimits
|
|
50
52
|
from trueconf.methods.get_message_by_id import GetMessageById
|
|
51
53
|
from trueconf.methods.get_user_display_name import GetUserDisplayName
|
|
52
54
|
from trueconf.methods.has_chat_participant import HasChatParticipant
|
|
@@ -62,12 +64,14 @@ from trueconf.methods.upload_file import UploadFile
|
|
|
62
64
|
from trueconf.types.input_file import InputFile, URLInputFile
|
|
63
65
|
from trueconf.types.parser import parse_update
|
|
64
66
|
from trueconf.types.requests.uploading_progress import UploadingProgress
|
|
67
|
+
from trueconf.types.responses import GetFileUploadLimitsResponse
|
|
65
68
|
from trueconf.types.responses.add_chat_participant_response import AddChatParticipantResponse
|
|
66
69
|
from trueconf.types.responses.change_participant_role_response import ChangeParticipantRoleResponse
|
|
67
70
|
from trueconf.types.responses.create_channel_response import CreateChannelResponse
|
|
68
71
|
from trueconf.types.responses.create_favorites_chat_response import CreateFavoritesChatResponse
|
|
69
72
|
from trueconf.types.responses.create_group_chat_response import CreateGroupChatResponse
|
|
70
73
|
from trueconf.types.responses.create_p2p_chat_response import CreateP2PChatResponse
|
|
74
|
+
from trueconf.types.responses.edit_chat_title_response import EditChatTitleResponse
|
|
71
75
|
from trueconf.types.responses.edit_message_response import EditMessageResponse
|
|
72
76
|
from trueconf.types.responses.edit_survey_response import EditSurveyResponse
|
|
73
77
|
from trueconf.types.responses.forward_message_response import ForwardMessageResponse
|
|
@@ -109,6 +113,7 @@ class Bot:
|
|
|
109
113
|
verify_ssl: bool = True,
|
|
110
114
|
dispatcher: Dispatcher | None = None,
|
|
111
115
|
receive_unread_messages: bool = False,
|
|
116
|
+
receive_system_messages: bool = False,
|
|
112
117
|
):
|
|
113
118
|
"""
|
|
114
119
|
Initializes a TrueConf chatbot instance with WebSocket connection and configuration options.
|
|
@@ -125,6 +130,7 @@ class Bot:
|
|
|
125
130
|
verify_ssl (bool, optional): Whether to verify the server's SSL certificate. Defaults to True.
|
|
126
131
|
dispatcher (Dispatcher | None, optional): Dispatcher instance for registering handlers.
|
|
127
132
|
receive_unread_messages (bool, optional): Whether to receive unread messages on connection. Defaults to False.
|
|
133
|
+
receive_system_messages (bool, optional): Whether to receive system messages on connection. Defaults to False.
|
|
128
134
|
|
|
129
135
|
Note:
|
|
130
136
|
Alternatively, you can authorize using a username and password via the `from_credentials()` class method.
|
|
@@ -146,6 +152,7 @@ class Bot:
|
|
|
146
152
|
self._protocol = "https" if self.https else "http"
|
|
147
153
|
self.port = 443 if self.https else self.web_port
|
|
148
154
|
self.receive_unread_messages = receive_unread_messages
|
|
155
|
+
self.receive_system_messages = receive_system_messages
|
|
149
156
|
self._url_for_upload_files = (
|
|
150
157
|
f"{self._protocol}://{self.server}:{self.port}/bridge/api/client/v1/files"
|
|
151
158
|
)
|
|
@@ -217,6 +224,7 @@ class Bot:
|
|
|
217
224
|
password: str,
|
|
218
225
|
dispatcher: Dispatcher | None = None,
|
|
219
226
|
receive_unread_messages: bool = False,
|
|
227
|
+
receive_system_messages: bool = False,
|
|
220
228
|
verify_ssl: bool = True,
|
|
221
229
|
**token_opts: Unpack[TokenOpts],
|
|
222
230
|
) -> Self:
|
|
@@ -232,6 +240,7 @@ class Bot:
|
|
|
232
240
|
password (str): Password for authentication.
|
|
233
241
|
dispatcher (Dispatcher | None, optional): Dispatcher instance for registering handlers.
|
|
234
242
|
receive_unread_messages (bool, optional): Whether to receive unread messages on connection. Defaults to False.
|
|
243
|
+
receive_system_messages (bool, optional): Whether to receive system messages on connection. Defaults to False.
|
|
235
244
|
verify_ssl (bool, optional): Whether to verify the server's SSL certificate. Defaults to True.
|
|
236
245
|
**token_opts: Additional options passed to the token request, such as `web_port` and `https`.
|
|
237
246
|
|
|
@@ -246,13 +255,14 @@ class Bot:
|
|
|
246
255
|
if not token:
|
|
247
256
|
raise RuntimeError("Failed to obtain token")
|
|
248
257
|
return cls(
|
|
249
|
-
server,
|
|
250
|
-
token,
|
|
251
|
-
web_port=token_opts.get("web_port", 443),
|
|
252
|
-
https=token_opts.get("https", True),
|
|
258
|
+
server=server,
|
|
259
|
+
token=token,
|
|
253
260
|
dispatcher=dispatcher,
|
|
254
261
|
receive_unread_messages=receive_unread_messages,
|
|
262
|
+
receive_system_messages=receive_system_messages,
|
|
255
263
|
verify_ssl=verify_ssl,
|
|
264
|
+
web_port=token_opts.get("web_port", 443),
|
|
265
|
+
https=token_opts.get("https", True),
|
|
256
266
|
)
|
|
257
267
|
|
|
258
268
|
async def __wait_upload_complete(
|
|
@@ -290,7 +300,7 @@ class Bot:
|
|
|
290
300
|
dest_path: str | Path | None = None,
|
|
291
301
|
timeout: int = 60,
|
|
292
302
|
chunk_size: int = 64 * 1024,
|
|
293
|
-
) ->
|
|
303
|
+
) -> bytes | None:
|
|
294
304
|
|
|
295
305
|
"""
|
|
296
306
|
Asynchronously download file by URL and save it to disk.
|
|
@@ -308,23 +318,24 @@ class Bot:
|
|
|
308
318
|
Path | None: Path to saved file, or None on error.
|
|
309
319
|
"""
|
|
310
320
|
|
|
311
|
-
if dest_path is None:
|
|
312
|
-
tmp = tempfile.NamedTemporaryFile(prefix="tc_dl_", suffix=file_name, delete=False)
|
|
313
|
-
dest = Path(tmp.name)
|
|
314
|
-
tmp.close()
|
|
315
|
-
else:
|
|
316
|
-
dest = Path(dest_path) / file_name
|
|
317
|
-
dest.parent.mkdir(parents=True, exist_ok=True)
|
|
318
|
-
|
|
319
321
|
try:
|
|
320
322
|
async with httpx.AsyncClient(verify=self.verify_ssl, timeout=httpx.Timeout(timeout)) as client:
|
|
321
323
|
async with client.stream("GET", url) as resp:
|
|
322
324
|
resp.raise_for_status()
|
|
323
|
-
|
|
325
|
+
if dest_path is None:
|
|
326
|
+
chunks = []
|
|
324
327
|
async for chunk in resp.aiter_bytes(chunk_size):
|
|
325
|
-
|
|
328
|
+
chunks.append(chunk)
|
|
329
|
+
return b"".join(chunks)
|
|
330
|
+
|
|
331
|
+
else:
|
|
332
|
+
dest = Path(dest_path) / file_name
|
|
333
|
+
dest.parent.mkdir(parents=True, exist_ok=True)
|
|
334
|
+
|
|
335
|
+
async with aiofiles.open(dest, "wb") as f:
|
|
336
|
+
async for chunk in resp.aiter_bytes(chunk_size):
|
|
326
337
|
await f.write(chunk)
|
|
327
|
-
|
|
338
|
+
return None
|
|
328
339
|
except Exception as e:
|
|
329
340
|
loggers.chatbot.error(f"Failed to download file from {url}: {e}")
|
|
330
341
|
with contextlib.suppress(Exception):
|
|
@@ -371,7 +382,7 @@ class Bot:
|
|
|
371
382
|
if preview:
|
|
372
383
|
await preview.prepare()
|
|
373
384
|
|
|
374
|
-
res = await self(UploadFile(file_size=file.file_size))
|
|
385
|
+
res = await self(UploadFile(file_size=file.file_size, file_name=file.file_name))
|
|
375
386
|
upload_task_id = res.upload_task_id
|
|
376
387
|
|
|
377
388
|
headers = {
|
|
@@ -395,16 +406,16 @@ class Bot:
|
|
|
395
406
|
data.add_field(
|
|
396
407
|
name="file",
|
|
397
408
|
value= await file.read(),
|
|
398
|
-
filename=file.
|
|
399
|
-
content_type="sticker/webp" if is_sticker else file.
|
|
409
|
+
filename=file.file_name,
|
|
410
|
+
content_type="sticker/webp" if is_sticker else file.mime_type,
|
|
400
411
|
)
|
|
401
412
|
|
|
402
413
|
if preview:
|
|
403
414
|
data.add_field(
|
|
404
415
|
name="preview",
|
|
405
416
|
value = await preview.read(),
|
|
406
|
-
filename=preview.
|
|
407
|
-
content_type=preview.
|
|
417
|
+
filename=preview.file_name,
|
|
418
|
+
content_type=preview.mime_type
|
|
408
419
|
)
|
|
409
420
|
|
|
410
421
|
async with session.post(self._url_for_upload_files, headers=headers, data=data) as response:
|
|
@@ -426,7 +437,13 @@ class Bot:
|
|
|
426
437
|
return False
|
|
427
438
|
|
|
428
439
|
async def __connect_and_listen(self):
|
|
429
|
-
ssl_context =
|
|
440
|
+
ssl_context = None
|
|
441
|
+
if self.https:
|
|
442
|
+
if self.verify_ssl:
|
|
443
|
+
ssl_context = ssl.create_default_context()
|
|
444
|
+
else:
|
|
445
|
+
ssl_context = ssl._create_unverified_context()
|
|
446
|
+
|
|
430
447
|
uri = f"wss://{self.server}:{self.web_port}/websocket/chat_bot" if self.https else f"ws://{self.server}:{self.web_port}/websocket/chat_bot"
|
|
431
448
|
|
|
432
449
|
while not self._stop:
|
|
@@ -486,7 +503,9 @@ class Bot:
|
|
|
486
503
|
loggers.chatbot.info("🚀 Starting authorization")
|
|
487
504
|
|
|
488
505
|
call = AuthMethod(
|
|
489
|
-
token=self.__token,
|
|
506
|
+
token=self.__token,
|
|
507
|
+
receive_unread_messages=self.receive_unread_messages,
|
|
508
|
+
|
|
490
509
|
)
|
|
491
510
|
loggers.chatbot.info(f"🛠 Created AuthMethod with id={call.id}")
|
|
492
511
|
result = await self(call)
|
|
@@ -776,6 +795,35 @@ class Bot:
|
|
|
776
795
|
dest_path=dest_path
|
|
777
796
|
)
|
|
778
797
|
|
|
798
|
+
async def edit_chat_title(self, chat_id: str, title: str) -> EditChatTitleResponse:
|
|
799
|
+
"""
|
|
800
|
+
Updates the display title of the specified chat.
|
|
801
|
+
|
|
802
|
+
Use this method to set a new visible name for a chat (e.g., a group chat or channel).
|
|
803
|
+
|
|
804
|
+
Notes:
|
|
805
|
+
Requires TrueConf Server 5.5.3 or later.
|
|
806
|
+
The bot must have sufficient permissions in the chat (e.g., owner or admin/moderator).
|
|
807
|
+
|
|
808
|
+
Source:
|
|
809
|
+
https://trueconf.com/docs/chatbot-connector/en/chats/#editChatTitle
|
|
810
|
+
|
|
811
|
+
Args:
|
|
812
|
+
chat_id (str): Identifier of the chat whose title should be updated.
|
|
813
|
+
title (str): New title for the chat.
|
|
814
|
+
|
|
815
|
+
Returns:
|
|
816
|
+
EditChatTitleResponse: Object containing the result of the title update.
|
|
817
|
+
|
|
818
|
+
Example:
|
|
819
|
+
```python
|
|
820
|
+
await bot.edit_chat_title(chat_id="a1s2d3f4f5g6", title="Project Alpha – Team")
|
|
821
|
+
```
|
|
822
|
+
"""
|
|
823
|
+
|
|
824
|
+
call = EditChatTitle(chat_id=chat_id, title=title)
|
|
825
|
+
return await self(call)
|
|
826
|
+
|
|
779
827
|
async def edit_message(
|
|
780
828
|
self, message_id: str, text: str, parse_mode: ParseMode | str = ParseMode.TEXT
|
|
781
829
|
) -> EditMessageResponse:
|
|
@@ -970,6 +1018,33 @@ class Bot:
|
|
|
970
1018
|
call = GetFileInfo(file_id=file_id)
|
|
971
1019
|
return await self(call)
|
|
972
1020
|
|
|
1021
|
+
async def get_file_info_upload_limits(self) -> GetFileUploadLimitsResponse:
|
|
1022
|
+
"""
|
|
1023
|
+
Returns the current file upload limits configured on the TrueConf Server.
|
|
1024
|
+
|
|
1025
|
+
Useful for validating outgoing files in advance (e.g., checking maximum
|
|
1026
|
+
file size and allowed types/extensions).
|
|
1027
|
+
|
|
1028
|
+
Notes:
|
|
1029
|
+
Requires TrueConf Server 5.5.3 or later.
|
|
1030
|
+
|
|
1031
|
+
Source:
|
|
1032
|
+
https://trueconf.com/docs/chatbot-connector/en/files/#getFileUploadLimits
|
|
1033
|
+
|
|
1034
|
+
Returns:
|
|
1035
|
+
GetFileUploadLimitsResponse: Object describing upload constraints
|
|
1036
|
+
(e.g., maximum file size, allowed types/extensions).
|
|
1037
|
+
|
|
1038
|
+
Example:
|
|
1039
|
+
```python
|
|
1040
|
+
limits = await bot.get_file_info_upload_limits()
|
|
1041
|
+
# Use `limits` fields to validate a file before uploading
|
|
1042
|
+
```
|
|
1043
|
+
"""
|
|
1044
|
+
|
|
1045
|
+
call = GetFileUploadLimits()
|
|
1046
|
+
return await self(call)
|
|
1047
|
+
|
|
973
1048
|
async def get_message_by_id(
|
|
974
1049
|
self, message_id: str
|
|
975
1050
|
) -> GetMessageByIdResponse:
|
|
@@ -1334,7 +1409,7 @@ class Bot:
|
|
|
1334
1409
|
```
|
|
1335
1410
|
"""
|
|
1336
1411
|
|
|
1337
|
-
if file.
|
|
1412
|
+
if file.mime_type != "image/webp":
|
|
1338
1413
|
raise TypeError("File type not supported. File type must be 'image/webp'")
|
|
1339
1414
|
|
|
1340
1415
|
loggers.chatbot.info(f"✉️ Sending file to {chat_id}")
|
|
@@ -10,11 +10,13 @@ from trueconf.filters.instance_of import InstanceOfFilter
|
|
|
10
10
|
from trueconf.filters.method import MethodFilter
|
|
11
11
|
from trueconf.types.message import Message
|
|
12
12
|
from trueconf.types.requests.added_chat_participant import AddedChatParticipant
|
|
13
|
+
from trueconf.types.requests.changed_file_upload_limits import ChangedFileUploadLimits
|
|
13
14
|
from trueconf.types.requests.changed_participant_role import ChangedParticipantRole
|
|
14
15
|
from trueconf.types.requests.created_channel import CreatedChannel
|
|
15
16
|
from trueconf.types.requests.created_favorites_chat import CreatedFavoritesChat
|
|
16
17
|
from trueconf.types.requests.created_group_chat import CreatedGroupChat
|
|
17
18
|
from trueconf.types.requests.created_personal_chat import CreatedPersonalChat
|
|
19
|
+
from trueconf.types.requests.edited_chat_title import EditedChatTitle
|
|
18
20
|
from trueconf.types.requests.edited_message import EditedMessage
|
|
19
21
|
from trueconf.types.requests.removed_chat import RemovedChat
|
|
20
22
|
from trueconf.types.requests.removed_chat_participant import RemovedChatParticipant
|
{python_trueconf_bot-1.1.7 → python_trueconf_bot-1.2.0b1}/trueconf/enums/incoming_update_method.py
RENAMED
|
@@ -4,10 +4,12 @@ from enum import Enum
|
|
|
4
4
|
class IncomingUpdateMethod(str, Enum):
|
|
5
5
|
ADDED_CHAT_PARTICIPANT = "addChatParticipant"
|
|
6
6
|
CHANGED_PARTICIPANT_ROLE = "changeParticipantRole"
|
|
7
|
+
CHANGED_FILE_UPLOAD_LIMITS = "getFileUploadLimits"
|
|
7
8
|
CREATED_CHANNEL = "createChannel"
|
|
8
9
|
CREATED_GROUP_CHAT = "createGroupChat"
|
|
9
10
|
CREATED_PERSONAL_CHAT = "createP2PChat"
|
|
10
11
|
CREATED_FAVORITES_CHAT = "createFavoritesChat"
|
|
12
|
+
EDITED_CHAT_TITLE = "editChatTitle"
|
|
11
13
|
EDITED_MESSAGE = "editMessage"
|
|
12
14
|
REMOVED_CHAT_PARTICIPANT = "removeChatParticipant"
|
|
13
15
|
REMOVED_MESSAGE = "removeMessage"
|
|
@@ -12,10 +12,14 @@ class MessageType(int, Enum):
|
|
|
12
12
|
|
|
13
13
|
ADD_PARTICIPANT = 1
|
|
14
14
|
REMOVE_PARTICIPANT = 2
|
|
15
|
+
EDIT_CHAT_TITLE = 21
|
|
16
|
+
EDIT_CHAT_AVATAR = 22
|
|
17
|
+
CLEAR_CHAT_HISTORY = 23
|
|
15
18
|
PARTICIPANT_ROLE = 110
|
|
16
19
|
PLAIN_MESSAGE = 200
|
|
17
20
|
FORWARDED_MESSAGE = 201
|
|
18
21
|
ATTACHMENT = 202
|
|
22
|
+
LOCATION = 203
|
|
19
23
|
SURVEY = 204
|
|
20
24
|
|
|
21
25
|
async def __call__(self, event: Any) -> bool:
|
|
@@ -6,6 +6,7 @@ from trueconf.methods.base import TrueConfMethod
|
|
|
6
6
|
from .create_channel import CreateChannel
|
|
7
7
|
from .create_group_chat import CreateGroupChat
|
|
8
8
|
from .create_p2p_chat import CreateP2PChat
|
|
9
|
+
from .edit_chat_title import EditChatTitle
|
|
9
10
|
from .edit_message import EditMessage
|
|
10
11
|
from .edit_survey import EditSurvey
|
|
11
12
|
from .forward_message import ForwardMessage
|
|
@@ -37,6 +38,7 @@ __all__ = [
|
|
|
37
38
|
'ForwardMessage',
|
|
38
39
|
'SendMessage',
|
|
39
40
|
'CreateChannel',
|
|
41
|
+
'EditChatTitle',
|
|
40
42
|
'EditMessage',
|
|
41
43
|
'GetChatHistory',
|
|
42
44
|
'GetChatParticipants',
|
|
@@ -12,6 +12,7 @@ class AuthMethod(TrueConfMethod[AuthResponsePayload]):
|
|
|
12
12
|
token: str
|
|
13
13
|
tokenType: str = "JWT"
|
|
14
14
|
receive_unread_messages: bool = False
|
|
15
|
+
receive_system_messages: bool = False
|
|
15
16
|
|
|
16
17
|
def __post_init__(self):
|
|
17
18
|
super().__init__()
|
|
@@ -20,6 +21,6 @@ class AuthMethod(TrueConfMethod[AuthResponsePayload]):
|
|
|
20
21
|
return {
|
|
21
22
|
"token": self.token,
|
|
22
23
|
"tokenType": self.tokenType,
|
|
23
|
-
"receiveUnread": self.receive_unread_messages
|
|
24
|
-
|
|
24
|
+
"receiveUnread": self.receive_unread_messages,
|
|
25
|
+
"receiveSystemMessageEnvelopes": self.receive_system_messages
|
|
25
26
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from trueconf.methods.base import TrueConfMethod
|
|
4
|
+
from trueconf.types.responses.edit_chat_title_response import EditChatTitleResponse
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass
|
|
8
|
+
class EditChatTitle(TrueConfMethod[EditChatTitleResponse]):
|
|
9
|
+
__api_method__ = "editChatTitle"
|
|
10
|
+
__returning__ = EditChatTitleResponse
|
|
11
|
+
|
|
12
|
+
chat_id: str
|
|
13
|
+
title: str
|
|
14
|
+
|
|
15
|
+
def __post_init__(self):
|
|
16
|
+
super().__init__()
|
|
17
|
+
|
|
18
|
+
def payload(self):
|
|
19
|
+
return {
|
|
20
|
+
"chatId": self.chat_id,
|
|
21
|
+
"title": self.title,
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from trueconf.methods.base import TrueConfMethod
|
|
4
|
+
from trueconf.types.responses import GetFileUploadLimitsResponse
|
|
5
|
+
|
|
6
|
+
@dataclass
|
|
7
|
+
class GetFileUploadLimits(TrueConfMethod[GetFileUploadLimitsResponse]):
|
|
8
|
+
__api_method__ = "getFileUploadLimits"
|
|
9
|
+
__returning__ = GetFileUploadLimitsResponse
|
|
10
|
+
|
|
11
|
+
def __post_init__(self):
|
|
12
|
+
super().__init__()
|
|
13
|
+
|
|
14
|
+
def payload(self):
|
|
15
|
+
return {
|
|
16
|
+
}
|
|
@@ -11,6 +11,7 @@ class UploadFile(TrueConfMethod[UploadFileResponse]):
|
|
|
11
11
|
__returning__ = UploadFileResponse
|
|
12
12
|
|
|
13
13
|
file_size: int
|
|
14
|
+
file_name: str
|
|
14
15
|
|
|
15
16
|
def __post_init__(self):
|
|
16
17
|
super().__init__()
|
|
@@ -18,4 +19,5 @@ class UploadFile(TrueConfMethod[UploadFileResponse]):
|
|
|
18
19
|
def payload(self):
|
|
19
20
|
return {
|
|
20
21
|
"fileSize": self.file_size,
|
|
22
|
+
"fileName": self.file_name,
|
|
21
23
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
from .message import Message
|
|
2
2
|
from .requests.added_chat_participant import AddedChatParticipant
|
|
3
|
+
from .requests.changed_file_upload_limits import ChangedFileUploadLimits
|
|
3
4
|
from .requests.changed_participant_role import ChangedParticipantRole
|
|
4
5
|
from .requests.created_channel import CreatedChannel
|
|
5
6
|
from .requests.created_group_chat import CreatedGroupChat
|
|
6
7
|
from .requests.created_personal_chat import CreatedPersonalChat
|
|
8
|
+
from .requests.edited_chat_title import EditedChatTitle
|
|
7
9
|
from .requests.edited_message import EditedMessage
|
|
8
10
|
from .requests.removed_chat import RemovedChat
|
|
9
11
|
from .requests.removed_chat_participant import RemovedChatParticipant
|
|
@@ -18,10 +20,12 @@ from .input_file import URLInputFile
|
|
|
18
20
|
|
|
19
21
|
__all__ = [
|
|
20
22
|
"AddedChatParticipant",
|
|
23
|
+
"ChangedFileUploadLimits",
|
|
21
24
|
"ChangedParticipantRole",
|
|
22
25
|
"CreatedChannel",
|
|
23
26
|
"CreatedGroupChat",
|
|
24
27
|
"CreatedPersonalChat",
|
|
28
|
+
"EditedChatTitle",
|
|
25
29
|
"EditedMessage",
|
|
26
30
|
"Message",
|
|
27
31
|
"RemovedChat",
|