diff --git a/.github/CONTRIBUTING.rst b/.github/CONTRIBUTING.rst index b8c4d3272..33e714bde 100644 --- a/.github/CONTRIBUTING.rst +++ b/.github/CONTRIBUTING.rst @@ -167,6 +167,7 @@ Feel free to copy (parts of) the checklist to the PR description to remind you o **If the PR contains API changes (otherwise, you can ignore this passage)** - Checked the Bot API specific sections of the `Stability Policy `_ +- Created a PR to remove functionality deprecated in the previous Bot API release (`see here `_) - New classes: diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 38b9e92a9..336682660 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,6 +1,6 @@ diff --git a/AUTHORS.rst b/AUTHORS.rst index 42eec2f58..f4e76fce8 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -21,6 +21,7 @@ Contributors The following wonderful people contributed directly or indirectly to this project: +- `Abdelrahman `_ - `Abshar `_ - `Alateas `_ - `Ales Dokshanin `_ diff --git a/README.rst b/README.rst index 28edf11f8..4b06d6158 100644 --- a/README.rst +++ b/README.rst @@ -30,7 +30,7 @@ :target: https://www.gnu.org/licenses/lgpl-3.0.html :alt: LGPLv3 License -.. image:: https://github.com/python-telegram-bot/python-telegram-bot/workflows/GitHub%20Actions/badge.svg +.. image:: https://github.com/python-telegram-bot/python-telegram-bot/workflows/Unit%20Tests/badge.svg :target: https://github.com/python-telegram-bot/python-telegram-bot/ :alt: Github Actions workflow diff --git a/README_RAW.rst b/README_RAW.rst index 8c1831435..afa118949 100644 --- a/README_RAW.rst +++ b/README_RAW.rst @@ -30,7 +30,7 @@ :target: https://www.gnu.org/licenses/lgpl-3.0.html :alt: LGPLv3 License -.. image:: https://github.com/python-telegram-bot/python-telegram-bot/workflows/GitHub%20Actions/badge.svg +.. image:: https://github.com/python-telegram-bot/python-telegram-bot/workflows/Unit%20Tests/badge.svg :target: https://github.com/python-telegram-bot/python-telegram-bot/ :alt: Github Actions workflow diff --git a/docs/auxil/kwargs_insertion.py b/docs/auxil/kwargs_insertion.py index 4cedfa6b5..d20127871 100644 --- a/docs/auxil/kwargs_insertion.py +++ b/docs/auxil/kwargs_insertion.py @@ -42,7 +42,7 @@ keyword_args = [ ] write_timeout_sub = [":attr:`~telegram.request.BaseRequest.DEFAULT_NONE`", "``20``"] read_timeout_sub = [ - ":attr:`~telegram.request.BaseRequest.DEFAULT_NONE`.", + ":attr:`~telegram.request.BaseRequest.DEFAULT_NONE`", "``2``. :paramref:`timeout` will be added to this value", ] read_timeout_type = [":obj:`float` | :obj:`None`", ":obj:`float`"] diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt index 010755608..72b21c28a 100644 --- a/docs/requirements-docs.txt +++ b/docs/requirements-docs.txt @@ -1,7 +1,7 @@ sphinx==7.2.5 sphinx-pypi-upload furo==2023.8.19 -git+https://github.com/harshil21/furo-sphinx-search@01efc7be422d7dc02390aab9be68d6f5ce1a5618#egg=furo-sphinx-search +git+https://github.com/harshil21/furo-sphinx-search@v0.2.0.1 sphinx-paramlinks==0.6.0 sphinxcontrib-mermaid==0.9.2 sphinx-copybutton==0.5.2 diff --git a/docs/source/conf.py b/docs/source/conf.py index 560eecc86..c4acd0759 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -23,7 +23,7 @@ author = "Leandro Toledo" # The short X.Y version. version = "20.4" # telegram.__version__[:3] # The full version, including alpha/beta/rc tags. -release = "20.3" # telegram.__version__ +release = "20.4" # telegram.__version__ # If your documentation needs a minimal Sphinx version, state it here. needs_sphinx = "6.1.3" diff --git a/docs/substitutions/global.rst b/docs/substitutions/global.rst index 4d2160833..6549b469a 100644 --- a/docs/substitutions/global.rst +++ b/docs/substitutions/global.rst @@ -57,3 +57,5 @@ .. |captionentitiesattr| replace:: Tuple of special entities that appear in the caption, which can be specified instead of ``parse_mode``. .. |datetime_localization| replace:: The default timezone of the bot is used for localization, which is UTC unless :attr:`telegram.ext.Defaults.tzinfo` is used. + +.. |post_methods_note| replace:: If you implement custom logic that implies that you will **not** be using :class:`~telegram.ext.Application`'s methods :meth:`~telegram.ext.Application.run_polling` or :meth:`~telegram.ext.Application.run_webhook` to run your application (like it's done in `Custom Webhook Bot Example `__), the callback you set in this method **will not be called automatically**. So instead of setting a callback with this method, you have to explicitly ``await`` the function that you want to run at this stage of your application's life (in the `example mentioned above `__, that would be in ``async with application`` context manager). diff --git a/telegram/_messageentity.py b/telegram/_messageentity.py index bc4de3d22..1ddcc6604 100644 --- a/telegram/_messageentity.py +++ b/telegram/_messageentity.py @@ -40,11 +40,13 @@ class MessageEntity(TelegramObject): Args: type (:obj:`str`): Type of the entity. Can be :attr:`MENTION` (@username), - :attr:`HASHTAG`, :attr:`BOT_COMMAND`, - :attr:`URL`, :attr:`EMAIL`, :attr:`PHONE_NUMBER`, :attr:`BOLD` (bold text), - :attr:`ITALIC` (italic text), :attr:`STRIKETHROUGH`, :attr:`SPOILER` (spoiler message), - :attr:`CODE` (monowidth string), :attr:`PRE` (monowidth block), :attr:`TEXT_LINK` (for - clickable text URLs), :attr:`TEXT_MENTION` (for users without usernames), + :attr:`HASHTAG` (#hashtag), :attr:`CASHTAG` ($USD), :attr:`BOT_COMMAND` + (/start@jobs_bot), :attr:`URL` (https://telegram.org), + :attr:`EMAIL` (do-not-reply@telegram.org), :attr:`PHONE_NUMBER` (+1-212-555-0123), + :attr:`BOLD` (**bold text**), :attr:`ITALIC` (*italic text*), :attr:`UNDERLINE` + (underlined text), :attr:`STRIKETHROUGH`, :attr:`SPOILER` (spoiler message), + :attr:`CODE` (monowidth string), :attr:`PRE` (monowidth block), :attr:`TEXT_LINK` + (for clickable text URLs), :attr:`TEXT_MENTION` (for users without usernames), :attr:`CUSTOM_EMOJI` (for inline custom emoji stickers). .. versionadded:: 20.0 @@ -64,11 +66,13 @@ class MessageEntity(TelegramObject): .. versionadded:: 20.0 Attributes: type (:obj:`str`): Type of the entity. Can be :attr:`MENTION` (@username), - :attr:`HASHTAG`, :attr:`BOT_COMMAND`, - :attr:`URL`, :attr:`EMAIL`, :attr:`PHONE_NUMBER`, :attr:`BOLD` (bold text), - :attr:`ITALIC` (italic text), :attr:`STRIKETHROUGH`, :attr:`SPOILER` (spoiler message), - :attr:`CODE` (monowidth string), :attr:`PRE` (monowidth block), :attr:`TEXT_LINK` (for - clickable text URLs), :attr:`TEXT_MENTION` (for users without usernames), + :attr:`HASHTAG` (#hashtag), :attr:`CASHTAG` ($USD), :attr:`BOT_COMMAND` + (/start@jobs_bot), :attr:`URL` (https://telegram.org), + :attr:`EMAIL` (do-not-reply@telegram.org), :attr:`PHONE_NUMBER` (+1-212-555-0123), + :attr:`BOLD` (**bold text**), :attr:`ITALIC` (*italic text*), :attr:`UNDERLINE` + (underlined text), :attr:`STRIKETHROUGH`, :attr:`SPOILER` (spoiler message), + :attr:`CODE` (monowidth string), :attr:`PRE` (monowidth block), :attr:`TEXT_LINK` + (for clickable text URLs), :attr:`TEXT_MENTION` (for users without usernames), :attr:`CUSTOM_EMOJI` (for inline custom emoji stickers). .. versionadded:: 20.0 diff --git a/telegram/error.py b/telegram/error.py index d84ebbb14..562733283 100644 --- a/telegram/error.py +++ b/telegram/error.py @@ -127,6 +127,9 @@ class NetworkError(TelegramError): Examples: :any:`Raw API Bot ` + + .. seealso:: + :wiki:`Handling network errors ` """ __slots__ = () @@ -141,6 +144,9 @@ class BadRequest(NetworkError): class TimedOut(NetworkError): """Raised when a request took too long to finish. + .. seealso:: + :wiki:`Handling network errors ` + Args: message (:obj:`str`, optional): Any additional information about the exception. diff --git a/telegram/ext/_application.py b/telegram/ext/_application.py index 36ee63316..1b4d3a6ba 100644 --- a/telegram/ext/_application.py +++ b/telegram/ext/_application.py @@ -693,7 +693,7 @@ class Application(Generic[BT, CCT, UD, CD, BD, JQ], AsyncContextManager["Applica On unix, the app will also shut down on receiving the signals specified by :paramref:`stop_signals`. - The order of execution by `run_polling` is roughly as follows: + The order of execution by :meth:`run_polling` is roughly as follows: - :meth:`initialize` - :meth:`post_init` @@ -708,11 +708,6 @@ class Application(Generic[BT, CCT, UD, CD, BD, JQ], AsyncContextManager["Applica .. include:: inclusions/application_run_tip.rst - .. seealso:: - :meth:`initialize`, :meth:`start`, :meth:`stop`, :meth:`shutdown` - :meth:`telegram.ext.Updater.start_polling`, :meth:`telegram.ext.Updater.stop`, - :meth:`run_webhook` - Args: poll_interval (:obj:`float`, optional): Time to wait between polling updates from Telegram in seconds. Default is ``0.0``. @@ -816,7 +811,7 @@ class Application(Generic[BT, CCT, UD, CD, BD, JQ], AsyncContextManager["Applica ``https://listen:port/url_path``. Also calls :meth:`telegram.Bot.set_webhook` as required. - The order of execution by `run_webhook` is roughly as follows: + The order of execution by :meth:`run_webhook` is roughly as follows: - :meth:`initialize` - :meth:`post_init` @@ -840,9 +835,7 @@ class Application(Generic[BT, CCT, UD, CD, BD, JQ], AsyncContextManager["Applica .. include:: inclusions/application_run_tip.rst .. seealso:: - :meth:`initialize`, :meth:`start`, :meth:`stop`, :meth:`shutdown` - :meth:`telegram.ext.Updater.start_webhook`, :meth:`telegram.ext.Updater.stop`, - :meth:`run_polling`, :wiki:`Webhooks` + :wiki:`Webhooks` Args: listen (:obj:`str`, optional): IP-Address to listen on. Defaults to diff --git a/telegram/ext/_applicationbuilder.py b/telegram/ext/_applicationbuilder.py index b636f6a23..e543239d0 100644 --- a/telegram/ext/_applicationbuilder.py +++ b/telegram/ext/_applicationbuilder.py @@ -473,6 +473,8 @@ class ApplicationBuilder(Generic[BT, CCT, UD, CD, BD, JQ]): .. include:: inclusions/pool_size_tip.rst + .. seealso:: :meth:`get_updates_connection_pool_size` + Args: connection_pool_size (:obj:`int`): The size of the connection pool. @@ -487,6 +489,9 @@ class ApplicationBuilder(Generic[BT, CCT, UD, CD, BD, JQ]): """Sets the proxy for the :paramref:`~telegram.request.HTTPXRequest.proxy_url` parameter of :attr:`telegram.Bot.request`. Defaults to :obj:`None`. + + .. seealso:: :meth:`get_updates_proxy_url` + Args: proxy_url (:obj:`str`): The URL to the proxy server. See :paramref:`telegram.request.HTTPXRequest.proxy_url` for more information. @@ -503,6 +508,8 @@ class ApplicationBuilder(Generic[BT, CCT, UD, CD, BD, JQ]): :paramref:`~telegram.request.HTTPXRequest.connect_timeout` parameter of :attr:`telegram.Bot.request`. Defaults to ``5.0``. + .. seealso:: :meth:`get_updates_connect_timeout` + Args: connect_timeout (:obj:`float`): See :paramref:`telegram.request.HTTPXRequest.connect_timeout` for more information. @@ -519,6 +526,8 @@ class ApplicationBuilder(Generic[BT, CCT, UD, CD, BD, JQ]): :paramref:`~telegram.request.HTTPXRequest.read_timeout` parameter of :attr:`telegram.Bot.request`. Defaults to ``5.0``. + .. seealso:: :meth:`get_updates_read_timeout` + Args: read_timeout (:obj:`float`): See :paramref:`telegram.request.HTTPXRequest.read_timeout` for more information. @@ -535,6 +544,8 @@ class ApplicationBuilder(Generic[BT, CCT, UD, CD, BD, JQ]): :paramref:`~telegram.request.HTTPXRequest.write_timeout` parameter of :attr:`telegram.Bot.request`. Defaults to ``5.0``. + .. seealso:: :meth:`get_updates_write_timeout` + Args: write_timeout (:obj:`float`): See :paramref:`telegram.request.HTTPXRequest.write_timeout` for more information. @@ -553,6 +564,8 @@ class ApplicationBuilder(Generic[BT, CCT, UD, CD, BD, JQ]): .. include:: inclusions/pool_size_tip.rst + .. seealso:: :meth:`get_updates_pool_timeout` + Args: pool_timeout (:obj:`float`): See :paramref:`telegram.request.HTTPXRequest.pool_timeout` for more information. @@ -629,6 +642,8 @@ class ApplicationBuilder(Generic[BT, CCT, UD, CD, BD, JQ]): :paramref:`telegram.request.HTTPXRequest.connection_pool_size` parameter which is used for the :meth:`telegram.Bot.get_updates` request. Defaults to ``1``. + .. seealso:: :meth:`connection_pool_size` + Args: get_updates_connection_pool_size (:obj:`int`): The size of the connection pool. @@ -643,6 +658,9 @@ class ApplicationBuilder(Generic[BT, CCT, UD, CD, BD, JQ]): """Sets the proxy for the :paramref:`telegram.request.HTTPXRequest.proxy_url` parameter which is used for :meth:`telegram.Bot.get_updates`. Defaults to :obj:`None`. + + .. seealso:: :meth:`proxy_url` + Args: get_updates_proxy_url (:obj:`str`): The URL to the proxy server. See :paramref:`telegram.request.HTTPXRequest.proxy_url` for more information. @@ -661,6 +679,8 @@ class ApplicationBuilder(Generic[BT, CCT, UD, CD, BD, JQ]): :paramref:`telegram.request.HTTPXRequest.connect_timeout` parameter which is used for the :meth:`telegram.Bot.get_updates` request. Defaults to ``5.0``. + .. seealso:: :meth:`connect_timeout` + Args: get_updates_connect_timeout (:obj:`float`): See :paramref:`telegram.request.HTTPXRequest.connect_timeout` for more information. @@ -679,6 +699,8 @@ class ApplicationBuilder(Generic[BT, CCT, UD, CD, BD, JQ]): :paramref:`telegram.request.HTTPXRequest.read_timeout` parameter which is used for the :meth:`telegram.Bot.get_updates` request. Defaults to ``5.0``. + .. seealso:: :meth:`read_timeout` + Args: get_updates_read_timeout (:obj:`float`): See :paramref:`telegram.request.HTTPXRequest.read_timeout` for more information. @@ -697,6 +719,8 @@ class ApplicationBuilder(Generic[BT, CCT, UD, CD, BD, JQ]): :paramref:`telegram.request.HTTPXRequest.write_timeout` parameter which is used for the :meth:`telegram.Bot.get_updates` request. Defaults to ``5.0``. + .. seealso:: :meth:`write_timeout` + Args: get_updates_write_timeout (:obj:`float`): See :paramref:`telegram.request.HTTPXRequest.write_timeout` for more information. @@ -715,6 +739,8 @@ class ApplicationBuilder(Generic[BT, CCT, UD, CD, BD, JQ]): :paramref:`~telegram.request.HTTPXRequest.pool_timeout` parameter which is used for the :meth:`telegram.Bot.get_updates` request. Defaults to ``1.0``. + .. seealso:: :meth:`pool_timeout` + Args: get_updates_pool_timeout (:obj:`float`): See :paramref:`telegram.request.HTTPXRequest.pool_timeout` for more information. @@ -1099,6 +1125,9 @@ class ApplicationBuilder(Generic[BT, CCT, UD, CD, BD, JQ]): application = Application.builder().token("TOKEN").post_init(post_init).build() + Note: + |post_methods_note| + .. seealso:: :meth:`post_stop`, :meth:`post_shutdown` Args: @@ -1137,6 +1166,9 @@ class ApplicationBuilder(Generic[BT, CCT, UD, CD, BD, JQ]): .post_shutdown(post_shutdown) .build() + Note: + |post_methods_note| + .. seealso:: :meth:`post_init`, :meth:`post_stop` Args: @@ -1177,6 +1209,9 @@ class ApplicationBuilder(Generic[BT, CCT, UD, CD, BD, JQ]): .post_stop(post_stop) .build() + Note: + |post_methods_note| + .. seealso:: :meth:`post_init`, :meth:`post_shutdown` Args: diff --git a/telegram/ext/_callbackqueryhandler.py b/telegram/ext/_callbackqueryhandler.py index f9f50c787..0cf5c5161 100644 --- a/telegram/ext/_callbackqueryhandler.py +++ b/telegram/ext/_callbackqueryhandler.py @@ -34,7 +34,7 @@ RT = TypeVar("RT") class CallbackQueryHandler(BaseHandler[Update, CCT]): - """BaseHandler class to handle Telegram + """Handler class to handle Telegram :attr:`callback queries `. Optionally based on a regex. Read the documentation of the :mod:`re` module for more information. diff --git a/telegram/ext/_chatjoinrequesthandler.py b/telegram/ext/_chatjoinrequesthandler.py index c8a46d989..59009d1d5 100644 --- a/telegram/ext/_chatjoinrequesthandler.py +++ b/telegram/ext/_chatjoinrequesthandler.py @@ -28,7 +28,7 @@ from telegram.ext._utils.types import CCT, HandlerCallback class ChatJoinRequestHandler(BaseHandler[Update, CCT]): - """BaseHandler class to handle Telegram updates that contain + """Handler class to handle Telegram updates that contain :attr:`telegram.Update.chat_join_request`. Note: diff --git a/telegram/ext/_chatmemberhandler.py b/telegram/ext/_chatmemberhandler.py index e46355b49..6edf39641 100644 --- a/telegram/ext/_chatmemberhandler.py +++ b/telegram/ext/_chatmemberhandler.py @@ -29,7 +29,7 @@ RT = TypeVar("RT") class ChatMemberHandler(BaseHandler[Update, CCT]): - """BaseHandler class to handle Telegram updates that contain a chat member update. + """Handler class to handle Telegram updates that contain a chat member update. Warning: When setting :paramref:`block` to :obj:`False`, you cannot rely on adding custom diff --git a/telegram/ext/_choseninlineresulthandler.py b/telegram/ext/_choseninlineresulthandler.py index 554c4e464..2e9a2c89a 100644 --- a/telegram/ext/_choseninlineresulthandler.py +++ b/telegram/ext/_choseninlineresulthandler.py @@ -33,7 +33,7 @@ if TYPE_CHECKING: class ChosenInlineResultHandler(BaseHandler[Update, CCT]): - """BaseHandler class to handle Telegram updates that contain + """Handler class to handle Telegram updates that contain :attr:`telegram.Update.chosen_inline_result`. Warning: diff --git a/telegram/ext/_commandhandler.py b/telegram/ext/_commandhandler.py index 37de7cb04..16e118074 100644 --- a/telegram/ext/_commandhandler.py +++ b/telegram/ext/_commandhandler.py @@ -34,7 +34,7 @@ RT = TypeVar("RT") class CommandHandler(BaseHandler[Update, CCT]): - """BaseHandler class to handle Telegram commands. + """Handler class to handle Telegram commands. Commands are Telegram messages that start with ``/``, optionally followed by an ``@`` and the bot's name and/or some additional text. The handler will add a :obj:`list` to the @@ -104,7 +104,7 @@ class CommandHandler(BaseHandler[Update, CCT]): commands (FrozenSet[:obj:`str`]): The set of commands this handler should listen for. callback (:term:`coroutine function`): The callback function for this handler. filters (:class:`telegram.ext.filters.BaseFilter`): Optional. Only allow updates with these - Filters. + filters. block (:obj:`bool`): Determines whether the return value of the callback should be awaited before processing the next handler in :meth:`telegram.ext.Application.process_update`. diff --git a/telegram/ext/_messagehandler.py b/telegram/ext/_messagehandler.py index 0a9c964c1..704647436 100644 --- a/telegram/ext/_messagehandler.py +++ b/telegram/ext/_messagehandler.py @@ -33,7 +33,7 @@ RT = TypeVar("RT") class MessageHandler(BaseHandler[Update, CCT]): - """BaseHandler class to handle Telegram messages. They might contain text, media or status + """Handler class to handle Telegram messages. They might contain text, media or status updates. Warning: diff --git a/telegram/ext/_pollanswerhandler.py b/telegram/ext/_pollanswerhandler.py index a900ba0ee..2aeec1757 100644 --- a/telegram/ext/_pollanswerhandler.py +++ b/telegram/ext/_pollanswerhandler.py @@ -25,7 +25,7 @@ from telegram.ext._utils.types import CCT class PollAnswerHandler(BaseHandler[Update, CCT]): - """BaseHandler class to handle Telegram updates that contain a + """Handler class to handle Telegram updates that contain a :attr:`poll answer `. Warning: diff --git a/telegram/ext/_pollhandler.py b/telegram/ext/_pollhandler.py index e6cab3581..453afea63 100644 --- a/telegram/ext/_pollhandler.py +++ b/telegram/ext/_pollhandler.py @@ -25,7 +25,7 @@ from telegram.ext._utils.types import CCT class PollHandler(BaseHandler[Update, CCT]): - """BaseHandler class to handle Telegram updates that contain a + """Handler class to handle Telegram updates that contain a :attr:`poll `. Warning: diff --git a/telegram/ext/_precheckoutqueryhandler.py b/telegram/ext/_precheckoutqueryhandler.py index 68e395953..25843aa94 100644 --- a/telegram/ext/_precheckoutqueryhandler.py +++ b/telegram/ext/_precheckoutqueryhandler.py @@ -25,7 +25,7 @@ from telegram.ext._utils.types import CCT class PreCheckoutQueryHandler(BaseHandler[Update, CCT]): - """BaseHandler class to handle Telegram :attr:`telegram.Update.pre_checkout_query`. + """Handler class to handle Telegram :attr:`telegram.Update.pre_checkout_query`. Warning: When setting :paramref:`block` to :obj:`False`, you cannot rely on adding custom diff --git a/telegram/ext/_prefixhandler.py b/telegram/ext/_prefixhandler.py index 571e9f7d7..9b60aebe6 100644 --- a/telegram/ext/_prefixhandler.py +++ b/telegram/ext/_prefixhandler.py @@ -34,7 +34,7 @@ RT = TypeVar("RT") class PrefixHandler(BaseHandler[Update, CCT]): - """BaseHandler class to handle custom prefix commands. + """Handler class to handle custom prefix commands. This is an intermediate handler between :class:`MessageHandler` and :class:`CommandHandler`. It supports configurable commands with the same options as :class:`CommandHandler`. It will diff --git a/telegram/ext/_shippingqueryhandler.py b/telegram/ext/_shippingqueryhandler.py index 4c2025aa5..7c840acb4 100644 --- a/telegram/ext/_shippingqueryhandler.py +++ b/telegram/ext/_shippingqueryhandler.py @@ -25,7 +25,7 @@ from telegram.ext._utils.types import CCT class ShippingQueryHandler(BaseHandler[Update, CCT]): - """BaseHandler class to handle Telegram :attr:`telegram.Update.shipping_query`. + """Handler class to handle Telegram :attr:`telegram.Update.shipping_query`. Warning: When setting :paramref:`block` to :obj:`False`, you cannot rely on adding custom diff --git a/telegram/ext/_stringcommandhandler.py b/telegram/ext/_stringcommandhandler.py index 2ae16c572..67c7b62b5 100644 --- a/telegram/ext/_stringcommandhandler.py +++ b/telegram/ext/_stringcommandhandler.py @@ -30,7 +30,7 @@ if TYPE_CHECKING: class StringCommandHandler(BaseHandler[str, CCT]): - """BaseHandler class to handle string commands. Commands are string updates that start with + """Handler class to handle string commands. Commands are string updates that start with ``/``. The handler will add a :obj:`list` to the :class:`CallbackContext` named :attr:`CallbackContext.args`. It will contain a list of strings, which is the text following the command split on single whitespace characters. diff --git a/telegram/ext/_stringregexhandler.py b/telegram/ext/_stringregexhandler.py index ce94bab23..539a92952 100644 --- a/telegram/ext/_stringregexhandler.py +++ b/telegram/ext/_stringregexhandler.py @@ -33,7 +33,7 @@ RT = TypeVar("RT") class StringRegexHandler(BaseHandler[str, CCT]): - """BaseHandler class to handle string updates based on a regex which checks the update content. + """Handler class to handle string updates based on a regex which checks the update content. Read the documentation of the :mod:`re` module for more information. The :func:`re.match` function is used to determine if an update should be handled by this handler. diff --git a/telegram/ext/_typehandler.py b/telegram/ext/_typehandler.py index e6a737644..90a68cf8f 100644 --- a/telegram/ext/_typehandler.py +++ b/telegram/ext/_typehandler.py @@ -30,7 +30,7 @@ UT = TypeVar("UT") class TypeHandler(BaseHandler[UT, CCT]): - """BaseHandler class to handle updates of custom types. + """Handler class to handle updates of custom types. Warning: When setting :paramref:`block` to :obj:`False`, you cannot rely on adding custom