pyTelegramBotAPI 4.32.0__tar.gz → 4.33.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.
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/PKG-INFO +4 -4
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/README.md +2 -2
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/conf.py +1 -1
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/pyproject.toml +2 -2
- pytelegrambotapi-4.33.0/requirements.txt +4 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/__init__.py +164 -11
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/apihelper.py +38 -5
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/async_telebot.py +181 -17
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/asyncio_helper.py +55 -13
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/handler_backends.py +4 -3
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/types.py +343 -36
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/util.py +725 -724
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/version.py +1 -1
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/tests/test_handler_backends.py +285 -285
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/tests/test_telebot.py +727 -726
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/tests/test_types.py +18 -6
- pytelegrambotapi-4.32.0/requirements.txt +0 -4
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/.github/ISSUE_TEMPLATE +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/.github/workflows/setup_python.yml +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/.gitignore +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/.readthedocs.yml +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/.travis.yml +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/LICENSE +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/doc_req.txt +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/Makefile +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/_static/logo.png +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/_static/logo2.png +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/async_version/index.rst +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/calldata.rst +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/formatting.rst +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/index.rst +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/install.rst +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/locales/en/LC_MESSAGES/async_version.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/locales/en/LC_MESSAGES/calldata.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/locales/en/LC_MESSAGES/formatting.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/locales/en/LC_MESSAGES/index.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/locales/en/LC_MESSAGES/install.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/locales/en/LC_MESSAGES/quick_start.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/locales/en/LC_MESSAGES/sync_version.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/locales/en/LC_MESSAGES/types.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/locales/en/LC_MESSAGES/util.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/locales/ru/LC_MESSAGES/async_version.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/locales/ru/LC_MESSAGES/calldata.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/locales/ru/LC_MESSAGES/formatting.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/locales/ru/LC_MESSAGES/index.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/locales/ru/LC_MESSAGES/install.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/locales/ru/LC_MESSAGES/quick_start.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/locales/ru/LC_MESSAGES/sync_version.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/locales/ru/LC_MESSAGES/types.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/locales/ru/LC_MESSAGES/util.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/quick_start.rst +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/sync_version/index.rst +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/types.rst +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/docs/source/util.rst +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/anonymous_bot.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/callback_data_examples/advanced_calendar_example/filters.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/callback_data_examples/advanced_calendar_example/keyboards.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/callback_data_examples/advanced_calendar_example/main.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/callback_data_examples/simple_products_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/chat_join_request.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/chat_member_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/continue_handling.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/custom_filters/admin_filter_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/custom_filters/advanced_text_filter.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/custom_filters/general_custom_filters.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/custom_filters/id_filter_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/custom_filters/is_filter_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/custom_filters/text_filter_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/custom_states.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/detect_changes.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/download_file_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/echo_bot.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/exception_handler.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/formatting_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/message_reaction_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/middleware/flooding_middleware.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/middleware/i18n.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/middleware/i18n_middleware_example/i18n_base_midddleware.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/middleware/i18n_middleware_example/keyboards.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/middleware/i18n_middleware_example/locales/en/LC_MESSAGES/messages.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/middleware/i18n_middleware_example/locales/ru/LC_MESSAGES/messages.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/middleware/i18n_middleware_example/locales/uz_Latn/LC_MESSAGES/messages.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/middleware/i18n_middleware_example/main.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/mini_app.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/multibot/README.MD +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/multibot/config.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/multibot/handlers.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/multibot/main.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/multibot/nginx_conf.conf +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/register_handler.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/send_file_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/send_message_draft_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/set_command_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/skip_updates_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/timer_bot_async.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/update_listener.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/webhooks/async_webhook_aiohttp_echo_bot.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/webhooks/run_webhooks.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/asynchronous_telebot/webhooks/webhook_starlette_echo_bot.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/callback_data_examples/advanced_calendar_example/filters.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/callback_data_examples/advanced_calendar_example/keyboards.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/callback_data_examples/advanced_calendar_example/main.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/callback_data_examples/simple_products_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/chat_join_request.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/chat_member_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/continue_handling.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/create_invite_link.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/custom_filters/admin_filter_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/custom_filters/advanced_text_filter.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/custom_filters/general_custom_filters.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/custom_filters/id_filter_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/custom_filters/is_filter_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/custom_filters/text_filter_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/custom_states.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/deep_linking.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/detailed_example/detailed_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/detailed_example/kitten.jpg +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/detailed_example/rooster.jpg +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/detect_changes.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/download_file_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/echo_bot.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/formatting_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/inline_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/inline_keyboard_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/message_reaction_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/middleware/README.md +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/middleware/class_based/antiflood_middleware.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/middleware/class_based/basic_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/middleware/class_based/i18n_middleware/i18n_base_middleware.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/middleware/class_based/i18n_middleware/keyboards.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/middleware/class_based/i18n_middleware/locales/en/LC_MESSAGES/messages.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/middleware/class_based/i18n_middleware/locales/ru/LC_MESSAGES/messages.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/middleware/class_based/i18n_middleware/locales/uz_Latn/LC_MESSAGES/messages.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/middleware/class_based/i18n_middleware/main.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/middleware/function_based/i18n.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/middleware/function_based/i18n_gettext/i18n_class.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/middleware/function_based/i18n_gettext/keyboards.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/middleware/function_based/i18n_gettext/locales/en/LC_MESSAGES/messages.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/middleware/function_based/i18n_gettext/locales/ru/LC_MESSAGES/messages.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/middleware/function_based/i18n_gettext/locales/uz_Latn/LC_MESSAGES/messages.po +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/middleware/function_based/i18n_gettext/main.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/middleware/function_based/session.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/mini_app.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/mini_app_web/index.html +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/mini_app_web/script.js +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/mini_app_web/style.css +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/multibot/README.MD +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/multibot/config.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/multibot/handlers.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/multibot/main.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/multibot/nginx_conf.conf +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/payments_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/poll_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/register_handler.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/reply_keyboard_markup_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/send_message_draft_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/serverless/aws_lambda_function.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/serverless/azure_functions +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/serverless/flask_google_cloud_bot/.gcloudignore +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/serverless/flask_google_cloud_bot/app.yaml +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/serverless/flask_google_cloud_bot/main.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/serverless/flask_google_cloud_bot/requirements.txt +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/set_command_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/skip_updates_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/stars_payment.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/step_example.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/telebot_bot/telebot_bot.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/timer_bot.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/webhook_examples/README.md +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/webhook_examples/run_webhooks.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/webhook_examples/webhook_aiohttp_echo_bot.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/webhook_examples/webhook_cherrypy_echo_bot.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/webhook_examples/webhook_cpython_echo_bot.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/webhook_examples/webhook_fastapi_echo_bot.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/webhook_examples/webhook_flask_echo_bot.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/webhook_examples/webhook_flask_heroku_echo.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/webhook_examples/webhook_tornado_echo_bot.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/examples/webhook_examples/webhook_twisted_echo_bot.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/asyncio_filters.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/asyncio_handler_backends.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/asyncio_storage/__init__.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/asyncio_storage/base_storage.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/asyncio_storage/memory_storage.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/asyncio_storage/pickle_storage.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/asyncio_storage/redis_storage.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/callback_data.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/custom_filters.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/ext/__init__.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/ext/aio/__init__.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/ext/aio/webhooks.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/ext/reloader.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/ext/sync/__init__.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/ext/sync/webhooks.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/formatting.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/py.typed +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/service_utils.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/states/__init__.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/states/asyncio/__init__.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/states/asyncio/context.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/states/asyncio/middleware.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/states/sync/__init__.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/states/sync/context.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/states/sync/middleware.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/storage/__init__.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/storage/base_storage.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/storage/memory_storage.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/storage/pickle_storage.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/telebot/storage/redis_storage.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/tests/__init__.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/tests/test_apihelper_95.py +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/tests/test_data/record.mp3 +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/tests/test_data/record.ogg +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/tests/test_data/record.wav +0 -0
- {pytelegrambotapi-4.32.0 → pytelegrambotapi-4.33.0}/tests/test_data/test_video.mp4 +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyTelegramBotAPI
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.33.0
|
|
4
4
|
Summary: Python Telegram bot API.
|
|
5
5
|
Project-URL: Homepage, https://github.com/eternnoir/pyTelegramBotAPI
|
|
6
6
|
Project-URL: Documentation, https://pytba.readthedocs.org
|
|
@@ -19,7 +19,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
-
Requires-Python: >=3.
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
23
|
Requires-Dist: requests
|
|
24
24
|
Provides-Extra: coloredlogs
|
|
25
25
|
Requires-Dist: coloredlogs; extra == 'coloredlogs'
|
|
@@ -51,7 +51,7 @@ Description-Content-Type: text/markdown
|
|
|
51
51
|
<p align="center">A simple, but extensible Python implementation for the <a href="https://core.telegram.org/bots/api">Telegram Bot API</a>.</p>
|
|
52
52
|
<p align="center">Both synchronous and asynchronous.</p>
|
|
53
53
|
|
|
54
|
-
## <p align="center">Supported Bot API version: <a href="https://core.telegram.org/bots/api#
|
|
54
|
+
## <p align="center">Supported Bot API version: <a href="https://core.telegram.org/bots/api-changelog#april-3-2026"><img src="https://img.shields.io/badge/Bot%20API-9.6-blue?logo=telegram" alt="Supported Bot API version"></a>
|
|
55
55
|
|
|
56
56
|
<h2><a href='https://pytba.readthedocs.io/en/latest/index.html'>Official documentation</a></h2>
|
|
57
57
|
<h2><a href='https://pytba.readthedocs.io/ru/latest/index.html'>Official ru documentation</a></h2>
|
|
@@ -110,7 +110,7 @@ Description-Content-Type: text/markdown
|
|
|
110
110
|
|
|
111
111
|
## Getting started
|
|
112
112
|
|
|
113
|
-
This API is tested with Python 3.
|
|
113
|
+
This API is tested with Python 3.10-3.14 and PyPy 3.
|
|
114
114
|
There are two ways to install the library:
|
|
115
115
|
|
|
116
116
|
* Installation using pip (a Python package manager):
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<p align="center">A simple, but extensible Python implementation for the <a href="https://core.telegram.org/bots/api">Telegram Bot API</a>.</p>
|
|
11
11
|
<p align="center">Both synchronous and asynchronous.</p>
|
|
12
12
|
|
|
13
|
-
## <p align="center">Supported Bot API version: <a href="https://core.telegram.org/bots/api#
|
|
13
|
+
## <p align="center">Supported Bot API version: <a href="https://core.telegram.org/bots/api-changelog#april-3-2026"><img src="https://img.shields.io/badge/Bot%20API-9.6-blue?logo=telegram" alt="Supported Bot API version"></a>
|
|
14
14
|
|
|
15
15
|
<h2><a href='https://pytba.readthedocs.io/en/latest/index.html'>Official documentation</a></h2>
|
|
16
16
|
<h2><a href='https://pytba.readthedocs.io/ru/latest/index.html'>Official ru documentation</a></h2>
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
|
|
70
70
|
## Getting started
|
|
71
71
|
|
|
72
|
-
This API is tested with Python 3.
|
|
72
|
+
This API is tested with Python 3.10-3.14 and PyPy 3.
|
|
73
73
|
There are two ways to install the library:
|
|
74
74
|
|
|
75
75
|
* Installation using pip (a Python package manager):
|
|
@@ -22,7 +22,7 @@ author = 'coder2020official'
|
|
|
22
22
|
copyright = f'2022-{datetime.now().year}, {author}'
|
|
23
23
|
|
|
24
24
|
# The full version, including alpha/beta/rc tags
|
|
25
|
-
release = '4.
|
|
25
|
+
release = '4.33.0'
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
# -- General configuration ---------------------------------------------------
|
|
@@ -4,12 +4,12 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pyTelegramBotAPI"
|
|
7
|
-
version = "4.
|
|
7
|
+
version = "4.33.0"
|
|
8
8
|
description = "Python Telegram bot API."
|
|
9
9
|
authors = [{name = "eternnoir", email = "eternnoir@gmail.com"}]
|
|
10
10
|
license = {text = "GPL2"}
|
|
11
11
|
readme = "README.md"
|
|
12
|
-
requires-python = ">=3.
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
13
|
keywords = ["telegram", "bot", "api", "tools"]
|
|
14
14
|
classifiers = [
|
|
15
15
|
"Development Status :: 5 - Production/Stable",
|
|
@@ -249,6 +249,7 @@ class TeleBot:
|
|
|
249
249
|
self.edited_business_message_handlers = []
|
|
250
250
|
self.deleted_business_messages_handlers = []
|
|
251
251
|
self.purchased_paid_media_handlers = []
|
|
252
|
+
self.managed_bot_handlers = []
|
|
252
253
|
|
|
253
254
|
self.custom_filters = {}
|
|
254
255
|
self.state_handlers = []
|
|
@@ -726,6 +727,7 @@ class TeleBot:
|
|
|
726
727
|
new_edited_business_messages = None
|
|
727
728
|
new_deleted_business_messages = None
|
|
728
729
|
new_purchased_paid_media = None
|
|
730
|
+
new_managed_bots = None
|
|
729
731
|
|
|
730
732
|
for update in updates:
|
|
731
733
|
if apihelper.ENABLE_MIDDLEWARE and not self.use_class_middlewares:
|
|
@@ -810,6 +812,9 @@ class TeleBot:
|
|
|
810
812
|
if update.purchased_paid_media:
|
|
811
813
|
if new_purchased_paid_media is None: new_purchased_paid_media = []
|
|
812
814
|
new_purchased_paid_media.append(update.purchased_paid_media)
|
|
815
|
+
if update.managed_bot:
|
|
816
|
+
if new_managed_bots is None: new_managed_bots = []
|
|
817
|
+
new_managed_bots.append(update.managed_bot)
|
|
813
818
|
|
|
814
819
|
if new_messages:
|
|
815
820
|
self.process_new_messages(new_messages)
|
|
@@ -857,6 +862,8 @@ class TeleBot:
|
|
|
857
862
|
self.process_new_deleted_business_messages(new_deleted_business_messages)
|
|
858
863
|
if new_purchased_paid_media:
|
|
859
864
|
self.process_new_purchased_paid_media(new_purchased_paid_media)
|
|
865
|
+
if new_managed_bots:
|
|
866
|
+
self.process_new_managed_bot(new_managed_bots)
|
|
860
867
|
|
|
861
868
|
def process_new_messages(self, new_messages):
|
|
862
869
|
"""
|
|
@@ -999,6 +1006,12 @@ class TeleBot:
|
|
|
999
1006
|
"""
|
|
1000
1007
|
self._notify_command_handlers(self.purchased_paid_media_handlers, new_purchased_paid_media, 'purchased_paid_media')
|
|
1001
1008
|
|
|
1009
|
+
def process_new_managed_bot(self, new_managed_bots):
|
|
1010
|
+
"""
|
|
1011
|
+
:meta private:
|
|
1012
|
+
"""
|
|
1013
|
+
self._notify_command_handlers(self.managed_bot_handlers, new_managed_bots, 'managed_bot')
|
|
1014
|
+
|
|
1002
1015
|
def process_middlewares(self, update):
|
|
1003
1016
|
"""
|
|
1004
1017
|
:meta private:
|
|
@@ -5227,6 +5240,33 @@ class TeleBot:
|
|
|
5227
5240
|
apihelper.get_business_connection(self.token, business_connection_id)
|
|
5228
5241
|
)
|
|
5229
5242
|
|
|
5243
|
+
def get_managed_bot_token(self, user_id: int) -> str:
|
|
5244
|
+
"""
|
|
5245
|
+
Use this method to get the token of a managed bot. Returns the token as String on success.
|
|
5246
|
+
|
|
5247
|
+
Telegram documentation: https://core.telegram.org/bots/api#getmanagedbottoken
|
|
5248
|
+
|
|
5249
|
+
:param user_id: User identifier of the managed bot whose token will be returned
|
|
5250
|
+
:type user_id: :obj:`int`
|
|
5251
|
+
|
|
5252
|
+
:return: Returns the token as String on success.
|
|
5253
|
+
:rtype: :obj:`str`
|
|
5254
|
+
"""
|
|
5255
|
+
return apihelper.get_managed_bot_token(self.token, user_id)
|
|
5256
|
+
|
|
5257
|
+
def replace_managed_bot_token(self, user_id: int) -> str:
|
|
5258
|
+
"""
|
|
5259
|
+
Use this method to revoke the current token of a managed bot and generate a new one. Returns the new token as String on success.
|
|
5260
|
+
|
|
5261
|
+
Telegram documentation: https://core.telegram.org/bots/api#replacemanagedbottoken
|
|
5262
|
+
|
|
5263
|
+
:param user_id: User identifier of the managed bot whose token will be replaced
|
|
5264
|
+
:type user_id: :obj:`int`
|
|
5265
|
+
|
|
5266
|
+
:return: Returns the new token as String on success.
|
|
5267
|
+
:rtype: :obj:`str`
|
|
5268
|
+
"""
|
|
5269
|
+
return apihelper.replace_managed_bot_token(self.token, user_id)
|
|
5230
5270
|
|
|
5231
5271
|
def set_my_commands(self, commands: List[types.BotCommand],
|
|
5232
5272
|
scope: Optional[types.BotCommandScope]=None,
|
|
@@ -6049,7 +6089,6 @@ class TeleBot:
|
|
|
6049
6089
|
send_email_to_provider=send_email_to_provider, is_flexible=is_flexible ,subscription_period=subscription_period,
|
|
6050
6090
|
business_connection_id=business_connection_id)
|
|
6051
6091
|
|
|
6052
|
-
|
|
6053
6092
|
# noinspection PyShadowingBuiltins
|
|
6054
6093
|
def send_poll(
|
|
6055
6094
|
self, chat_id: Union[int, str], question: str, options: List[Union[str, types.InputPollOption]],
|
|
@@ -6074,7 +6113,15 @@ class TeleBot:
|
|
|
6074
6113
|
question_parse_mode: Optional[str] = None,
|
|
6075
6114
|
question_entities: Optional[List[types.MessageEntity]] = None,
|
|
6076
6115
|
message_effect_id: Optional[str]=None,
|
|
6077
|
-
allow_paid_broadcast: Optional[bool]=None
|
|
6116
|
+
allow_paid_broadcast: Optional[bool]=None,
|
|
6117
|
+
allows_revoting: Optional[bool]=None,
|
|
6118
|
+
shuffle_options: Optional[bool]=None,
|
|
6119
|
+
allow_adding_options: Optional[bool]=None,
|
|
6120
|
+
hide_results_until_closes: Optional[bool]=None,
|
|
6121
|
+
correct_option_ids: Optional[List[int]]=None,
|
|
6122
|
+
description: Optional[str]=None,
|
|
6123
|
+
description_parse_mode: Optional[str]=None,
|
|
6124
|
+
description_entities: Optional[List[types.MessageEntity]]=None) -> types.Message:
|
|
6078
6125
|
"""
|
|
6079
6126
|
Use this method to send a native poll.
|
|
6080
6127
|
On success, the sent Message is returned.
|
|
@@ -6096,10 +6143,10 @@ class TeleBot:
|
|
|
6096
6143
|
:param type: Poll type, “quiz” or “regular”, defaults to “regular”
|
|
6097
6144
|
:type type: :obj:`str`
|
|
6098
6145
|
|
|
6099
|
-
:param allows_multiple_answers: True, if the poll allows multiple answers,
|
|
6146
|
+
:param allows_multiple_answers: True, if the poll allows multiple answers, defaults to False
|
|
6100
6147
|
:type allows_multiple_answers: :obj:`bool`
|
|
6101
6148
|
|
|
6102
|
-
:param correct_option_id:
|
|
6149
|
+
:param correct_option_id: Deprecated, use correct_option_ids instead.
|
|
6103
6150
|
:type correct_option_id: :obj:`int`
|
|
6104
6151
|
|
|
6105
6152
|
:param explanation: Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing
|
|
@@ -6108,10 +6155,11 @@ class TeleBot:
|
|
|
6108
6155
|
:param explanation_parse_mode: Mode for parsing entities in the explanation. See formatting options for more details.
|
|
6109
6156
|
:type explanation_parse_mode: :obj:`str`
|
|
6110
6157
|
|
|
6111
|
-
:param open_period: Amount of time in seconds the poll will be active after creation, 5-
|
|
6158
|
+
:param open_period: Amount of time in seconds the poll will be active after creation, 5-2628000. Can't be used together with close_date.
|
|
6112
6159
|
:type open_period: :obj:`int`
|
|
6113
6160
|
|
|
6114
6161
|
:param close_date: Point in time (Unix timestamp) when the poll will be automatically closed.
|
|
6162
|
+
Must be at least 5 and no more than 2628000 seconds in the future. Can't be used together with open_period.
|
|
6115
6163
|
:type close_date: :obj:`int` | :obj:`datetime`
|
|
6116
6164
|
|
|
6117
6165
|
:param is_closed: Pass True, if the poll needs to be immediately closed. This can be useful for poll preview.
|
|
@@ -6160,6 +6208,30 @@ class TeleBot:
|
|
|
6160
6208
|
of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
|
|
6161
6209
|
:type allow_paid_broadcast: :obj:`bool`
|
|
6162
6210
|
|
|
6211
|
+
:param allows_revoting: Pass True, if the poll allows to change chosen answer options, defaults to False for quizzes and to True for regular polls
|
|
6212
|
+
:type allows_revoting: :obj:`bool`
|
|
6213
|
+
|
|
6214
|
+
:param shuffle_options: Pass True, if the poll options must be shown in random order
|
|
6215
|
+
:type shuffle_options: :obj:`bool`
|
|
6216
|
+
|
|
6217
|
+
:param allow_adding_options: Pass True, if answer options can be added to the poll after creation; not supported for anonymous polls and quizzes
|
|
6218
|
+
:type allow_adding_options: :obj:`bool`
|
|
6219
|
+
|
|
6220
|
+
:param hide_results_until_closes: Pass True, if poll results must be shown only after the poll closes
|
|
6221
|
+
:type hide_results_until_closes: :obj:`bool`
|
|
6222
|
+
|
|
6223
|
+
:param correct_option_ids: A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, required for polls in quiz mode
|
|
6224
|
+
:type correct_option_ids: :obj:`list` of :obj:`int`
|
|
6225
|
+
|
|
6226
|
+
:param description: Description of the poll to be sent, 0-1024 characters after entities parsing
|
|
6227
|
+
:type description: :obj:`str`
|
|
6228
|
+
|
|
6229
|
+
:param description_parse_mode: Mode for parsing entities in the poll description. See formatting options for more details.
|
|
6230
|
+
:type description_parse_mode: :obj:`str`
|
|
6231
|
+
|
|
6232
|
+
:param description_entities: A JSON-serialized list of special entities that appear in the poll description, which can be specified instead of description_parse_mode
|
|
6233
|
+
:type description_entities: :obj:`list` of :obj:`MessageEntity`
|
|
6234
|
+
|
|
6163
6235
|
:return: On success, the sent Message is returned.
|
|
6164
6236
|
:rtype: :obj:`types.Message`
|
|
6165
6237
|
"""
|
|
@@ -6192,6 +6264,7 @@ class TeleBot:
|
|
|
6192
6264
|
|
|
6193
6265
|
explanation_parse_mode = self.parse_mode if (explanation_parse_mode is None) else explanation_parse_mode
|
|
6194
6266
|
question_parse_mode = self.parse_mode if (question_parse_mode is None) else question_parse_mode
|
|
6267
|
+
description_parse_mode = self.parse_mode if (description_parse_mode is None) else description_parse_mode
|
|
6195
6268
|
|
|
6196
6269
|
if options and (not isinstance(options[0], types.InputPollOption)):
|
|
6197
6270
|
# show a deprecation warning
|
|
@@ -6203,19 +6276,33 @@ class TeleBot:
|
|
|
6203
6276
|
options = [types.InputPollOption(option.text, text_entities=option.text_entities) for option in options]
|
|
6204
6277
|
else:
|
|
6205
6278
|
raise RuntimeError("Type of 'options' items is unknown. Options should be List[types.InputPollOption], other types are deprecated.")
|
|
6279
|
+
|
|
6280
|
+
# handle deprecated correct_option_id parameter
|
|
6281
|
+
if correct_option_id is not None:
|
|
6282
|
+
if correct_option_ids is not None:
|
|
6283
|
+
# show a conflict warning
|
|
6284
|
+
logger.warning("Both 'correct_option_id' and 'correct_option_ids' parameters are set: use 'correct_option_ids' instead.")
|
|
6285
|
+
else:
|
|
6286
|
+
# convert correct_option_id to correct_option_ids
|
|
6287
|
+
correct_option_ids = [correct_option_id]
|
|
6288
|
+
logger.warning("The parameter 'correct_option_id' is deprecated, use 'correct_option_ids' instead.")
|
|
6289
|
+
|
|
6206
6290
|
|
|
6207
6291
|
return types.Message.de_json(
|
|
6208
6292
|
apihelper.send_poll(
|
|
6209
6293
|
self.token, chat_id, question, options,
|
|
6210
6294
|
is_anonymous=is_anonymous, type=type, allows_multiple_answers=allows_multiple_answers,
|
|
6211
|
-
|
|
6295
|
+
explanation=explanation,
|
|
6212
6296
|
explanation_parse_mode=explanation_parse_mode, open_period=open_period,
|
|
6213
6297
|
close_date=close_date, is_closed=is_closed, disable_notification=disable_notification,
|
|
6214
6298
|
reply_markup=reply_markup, timeout=timeout, explanation_entities=explanation_entities,
|
|
6215
6299
|
protect_content=protect_content, message_thread_id=message_thread_id,
|
|
6216
6300
|
reply_parameters=reply_parameters, business_connection_id=business_connection_id,
|
|
6217
6301
|
question_parse_mode=question_parse_mode, question_entities=question_entities,
|
|
6218
|
-
message_effect_id=message_effect_id, allow_paid_broadcast=allow_paid_broadcast
|
|
6302
|
+
message_effect_id=message_effect_id, allow_paid_broadcast=allow_paid_broadcast,
|
|
6303
|
+
allows_revoting=allows_revoting, shuffle_options=shuffle_options,
|
|
6304
|
+
allow_adding_options=allow_adding_options, hide_results_until_closes=hide_results_until_closes, correct_option_ids=correct_option_ids,
|
|
6305
|
+
description=description, description_parse_mode=description_parse_mode, description_entities=description_entities)
|
|
6219
6306
|
)
|
|
6220
6307
|
|
|
6221
6308
|
|
|
@@ -6796,10 +6883,10 @@ class TeleBot:
|
|
|
6796
6883
|
:param text: Text that will be shown along with the gift; 0-255 characters
|
|
6797
6884
|
:type text: :obj:`str`
|
|
6798
6885
|
|
|
6799
|
-
:param text_parse_mode: Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “
|
|
6886
|
+
:param text_parse_mode: Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored.
|
|
6800
6887
|
:type text_parse_mode: :obj:`str`
|
|
6801
6888
|
|
|
6802
|
-
:param text_entities: A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “
|
|
6889
|
+
:param text_entities: A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored.
|
|
6803
6890
|
:type text_entities: :obj:`list` of :obj:`types.MessageEntity`
|
|
6804
6891
|
|
|
6805
6892
|
:return: Returns True on success.
|
|
@@ -7503,10 +7590,10 @@ class TeleBot:
|
|
|
7503
7590
|
:param text: Text that will be shown along with the service message about the subscription; 0-128 characters
|
|
7504
7591
|
:type text: :obj:`str`
|
|
7505
7592
|
|
|
7506
|
-
:param text_parse_mode: Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “
|
|
7593
|
+
:param text_parse_mode: Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored.
|
|
7507
7594
|
:type text_parse_mode: :obj:`str`
|
|
7508
7595
|
|
|
7509
|
-
:param text_entities: A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “
|
|
7596
|
+
:param text_entities: A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored.
|
|
7510
7597
|
:type text_entities: :obj:`list` of :class:`telebot.types.MessageEntity`
|
|
7511
7598
|
|
|
7512
7599
|
:return: Returns True on success.
|
|
@@ -8127,6 +8214,25 @@ class TeleBot:
|
|
|
8127
8214
|
self.token, user_id, result, allow_user_chats=allow_user_chats, allow_bot_chats=allow_bot_chats,
|
|
8128
8215
|
allow_group_chats=allow_group_chats, allow_channel_chats=allow_channel_chats)
|
|
8129
8216
|
)
|
|
8217
|
+
|
|
8218
|
+
def save_prepared_keyboard_button(self, user_id: int, button: types.KeyboardButton) -> types.PreparedKeyboardButton:
|
|
8219
|
+
"""
|
|
8220
|
+
Use this method to store a keyboard button that can be used by a user within a Mini App. Returns a PreparedKeyboardButton object.
|
|
8221
|
+
|
|
8222
|
+
Telegram Documentation: https://core.telegram.org/bots/api#savepreparedkeyboardbutton
|
|
8223
|
+
|
|
8224
|
+
:param user_id: Unique identifier of the target user that can use the button
|
|
8225
|
+
:type user_id: :obj:`int`
|
|
8226
|
+
|
|
8227
|
+
:param button: A JSON-serialized object describing the button to be saved. The button must be of the type request_users, request_chat, or request_managed_bot
|
|
8228
|
+
:type button: :class:`telebot.types.KeyboardButton`
|
|
8229
|
+
|
|
8230
|
+
:return: On success, a PreparedKeyboardButton object is returned.
|
|
8231
|
+
:rtype: :class:`telebot.types.PreparedKeyboardButton`
|
|
8232
|
+
"""
|
|
8233
|
+
return types.PreparedKeyboardButton.de_json(
|
|
8234
|
+
apihelper.save_prepared_keyboard_button(self.token, user_id, button)
|
|
8235
|
+
)
|
|
8130
8236
|
|
|
8131
8237
|
def register_for_reply(self, message: types.Message, callback: Callable, *args, **kwargs) -> None:
|
|
8132
8238
|
"""
|
|
@@ -10346,6 +10452,53 @@ class TeleBot:
|
|
|
10346
10452
|
handler_dict = self._build_handler_dict(callback, func=func, pass_bot=pass_bot, **kwargs)
|
|
10347
10453
|
self.add_deleted_business_messages_handler(handler_dict)
|
|
10348
10454
|
|
|
10455
|
+
def managed_bot_handler(self, func=None, **kwargs):
|
|
10456
|
+
"""
|
|
10457
|
+
Handles new incoming updates about managed bot. As a parameter to the decorator function, it passes :class:`telebot.types.ManagedBotUpdated` object.
|
|
10458
|
+
|
|
10459
|
+
:param func: Function executed as a filter
|
|
10460
|
+
:type func: :obj:`function`
|
|
10461
|
+
|
|
10462
|
+
:param kwargs: Optional keyword arguments(custom filters)
|
|
10463
|
+
:return: None
|
|
10464
|
+
"""
|
|
10465
|
+
def decorator(handler):
|
|
10466
|
+
handler_dict = self._build_handler_dict(handler, func=func, **kwargs)
|
|
10467
|
+
self.add_managed_bot_handler(handler_dict)
|
|
10468
|
+
return handler
|
|
10469
|
+
|
|
10470
|
+
return decorator
|
|
10471
|
+
|
|
10472
|
+
def add_managed_bot_handler(self, handler_dict):
|
|
10473
|
+
"""
|
|
10474
|
+
Adds a managed_bot handler.
|
|
10475
|
+
Note that you should use register_managed_bot_handler to add managed_bot_handler to the bot.
|
|
10476
|
+
|
|
10477
|
+
:meta private:
|
|
10478
|
+
:param handler_dict:
|
|
10479
|
+
:return:
|
|
10480
|
+
"""
|
|
10481
|
+
self.managed_bot_handlers.append(handler_dict)
|
|
10482
|
+
|
|
10483
|
+
def register_managed_bot_handler(self, callback: Callable, func: Optional[Callable]=None, pass_bot: Optional[bool]=False, **kwargs):
|
|
10484
|
+
"""
|
|
10485
|
+
Registers managed bot handler.
|
|
10486
|
+
|
|
10487
|
+
:param callback: function to be called
|
|
10488
|
+
:type callback: :obj:`function`
|
|
10489
|
+
|
|
10490
|
+
:param func: Function executed as a filter
|
|
10491
|
+
:type func: :obj:`function`
|
|
10492
|
+
|
|
10493
|
+
:param pass_bot: True if you need to pass TeleBot instance to handler(useful for separating handlers into different files)
|
|
10494
|
+
:type pass_bot: :obj:`bool`
|
|
10495
|
+
|
|
10496
|
+
:param kwargs: Optional keyword arguments(custom filters)
|
|
10497
|
+
:return: None
|
|
10498
|
+
"""
|
|
10499
|
+
handler_dict = self._build_handler_dict(callback, func=func, pass_bot=pass_bot, **kwargs)
|
|
10500
|
+
self.add_managed_bot_handler(handler_dict)
|
|
10501
|
+
|
|
10349
10502
|
|
|
10350
10503
|
def add_custom_filter(self, custom_filter: Union[SimpleCustomFilter, AdvancedCustomFilter]):
|
|
10351
10504
|
"""
|
|
@@ -1606,6 +1606,16 @@ def get_business_connection(token, business_connection_id):
|
|
|
1606
1606
|
payload = {'business_connection_id': business_connection_id}
|
|
1607
1607
|
return _make_request(token, method_url, params=payload , method='post')
|
|
1608
1608
|
|
|
1609
|
+
def get_managed_bot_token(token, user_id):
|
|
1610
|
+
method_url = 'getManagedBotToken'
|
|
1611
|
+
payload = {'user_id': user_id}
|
|
1612
|
+
return _make_request(token, method_url, params=payload , method='post')
|
|
1613
|
+
|
|
1614
|
+
def replace_managed_bot_token(token, user_id):
|
|
1615
|
+
method_url = 'replaceManagedBotToken'
|
|
1616
|
+
payload = {'user_id': user_id}
|
|
1617
|
+
return _make_request(token, method_url, params=payload , method='post')
|
|
1618
|
+
|
|
1609
1619
|
def delete_my_commands(token, scope=None, language_code=None):
|
|
1610
1620
|
method_url = r'deleteMyCommands'
|
|
1611
1621
|
payload = {}
|
|
@@ -1893,7 +1903,9 @@ def send_invoice(
|
|
|
1893
1903
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
|
|
1894
1904
|
:param reply_parameters: A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.
|
|
1895
1905
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only
|
|
1896
|
-
:param allow_paid_broadcast:
|
|
1906
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
|
|
1907
|
+
:param direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
|
|
1908
|
+
:param suggested_post_parameters: A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
|
|
1897
1909
|
:return:
|
|
1898
1910
|
"""
|
|
1899
1911
|
method_url = r'sendInvoice'
|
|
@@ -2486,6 +2498,12 @@ def save_prepared_inline_message(token, user_id, result: types.InlineQueryResult
|
|
|
2486
2498
|
return _make_request(token, method_url, params=payload, method='post')
|
|
2487
2499
|
|
|
2488
2500
|
|
|
2501
|
+
def save_prepared_keyboard_button(token, user_id, button):
|
|
2502
|
+
method_url = 'savePreparedKeyboardButton'
|
|
2503
|
+
payload = {'user_id': user_id, 'button': button.to_json()}
|
|
2504
|
+
return _make_request(token, method_url, params=payload, method='post')
|
|
2505
|
+
|
|
2506
|
+
|
|
2489
2507
|
def create_invoice_link(token, title, description, payload, provider_token,
|
|
2490
2508
|
currency, prices, max_tip_amount=None, suggested_tip_amounts=None, provider_data=None,
|
|
2491
2509
|
photo_url=None, photo_size=None, photo_width=None, photo_height=None, need_name=None, need_phone_number=None,
|
|
@@ -2534,11 +2552,12 @@ def create_invoice_link(token, title, description, payload, provider_token,
|
|
|
2534
2552
|
# noinspection PyShadowingBuiltins
|
|
2535
2553
|
def send_poll(
|
|
2536
2554
|
token, chat_id, question, options,
|
|
2537
|
-
is_anonymous = None, type = None, allows_multiple_answers = None,
|
|
2555
|
+
is_anonymous = None, type = None, allows_multiple_answers = None, explanation = None,
|
|
2538
2556
|
explanation_parse_mode=None, open_period = None, close_date = None, is_closed = None, disable_notification=False,
|
|
2539
2557
|
reply_markup=None, timeout=None, explanation_entities=None, protect_content=None, message_thread_id=None,
|
|
2540
2558
|
reply_parameters=None, business_connection_id=None, question_parse_mode=None, question_entities=None, message_effect_id=None,
|
|
2541
|
-
allow_paid_broadcast=None
|
|
2559
|
+
allow_paid_broadcast=None, allows_revoting=None, shuffle_options=None, allow_adding_options=None, hide_results_until_closes=None,
|
|
2560
|
+
correct_option_ids=None, description=None, description_parse_mode=None, description_entities=None):
|
|
2542
2561
|
method_url = r'sendPoll'
|
|
2543
2562
|
payload = {
|
|
2544
2563
|
'chat_id': str(chat_id),
|
|
@@ -2552,8 +2571,6 @@ def send_poll(
|
|
|
2552
2571
|
payload['type'] = type
|
|
2553
2572
|
if allows_multiple_answers is not None:
|
|
2554
2573
|
payload['allows_multiple_answers'] = allows_multiple_answers
|
|
2555
|
-
if correct_option_id is not None:
|
|
2556
|
-
payload['correct_option_id'] = correct_option_id
|
|
2557
2574
|
if explanation:
|
|
2558
2575
|
payload['explanation'] = explanation
|
|
2559
2576
|
if explanation_parse_mode:
|
|
@@ -2591,6 +2608,22 @@ def send_poll(
|
|
|
2591
2608
|
payload['message_effect_id'] = message_effect_id
|
|
2592
2609
|
if allow_paid_broadcast is not None:
|
|
2593
2610
|
payload['allow_paid_broadcast'] = allow_paid_broadcast
|
|
2611
|
+
if allows_revoting is not None:
|
|
2612
|
+
payload['allows_revoting'] = allows_revoting
|
|
2613
|
+
if shuffle_options is not None:
|
|
2614
|
+
payload['shuffle_options'] = shuffle_options
|
|
2615
|
+
if allow_adding_options is not None:
|
|
2616
|
+
payload['allow_adding_options'] = allow_adding_options
|
|
2617
|
+
if hide_results_until_closes is not None:
|
|
2618
|
+
payload['hide_results_until_closes'] = hide_results_until_closes
|
|
2619
|
+
if correct_option_ids is not None:
|
|
2620
|
+
payload['correct_option_ids'] = json.dumps(correct_option_ids)
|
|
2621
|
+
if description is not None:
|
|
2622
|
+
payload['description'] = description
|
|
2623
|
+
if description_parse_mode is not None:
|
|
2624
|
+
payload['description_parse_mode'] = description_parse_mode
|
|
2625
|
+
if description_entities is not None:
|
|
2626
|
+
payload['description_entities'] = json.dumps(types.MessageEntity.to_list_of_dicts(description_entities))
|
|
2594
2627
|
return _make_request(token, method_url, params=payload)
|
|
2595
2628
|
|
|
2596
2629
|
def create_forum_topic(token, chat_id, name, icon_color=None, icon_custom_emoji_id=None):
|