From 22eb434a62eacc2273b15f1644aa18c1acb76b34 Mon Sep 17 00:00:00 2001 From: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com> Date: Wed, 6 Mar 2024 21:09:47 +0100 Subject: [PATCH] Bump version to v21.0 --- CHANGES.rst | 48 +++++++++++++ docs/source/conf.py | 4 +- telegram/_bot.py | 76 ++++++++++----------- telegram/_chat.py | 8 +-- telegram/_chatadministratorrights.py | 14 ++-- telegram/_chatboost.py | 2 +- telegram/_chatmember.py | 14 ++-- telegram/_inline/inputtextmessagecontent.py | 2 +- telegram/_keyboardbutton.py | 2 +- telegram/_message.py | 16 ++--- telegram/_story.py | 2 +- telegram/_version.py | 2 +- telegram/constants.py | 6 +- telegram/ext/_applicationbuilder.py | 2 +- telegram/ext/filters.py | 2 +- telegram/request/_httpxrequest.py | 2 +- tests/test_official/exceptions.py | 4 +- 17 files changed, 127 insertions(+), 79 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 39120d902..df5bc7a74 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,54 @@ Changelog ========= +Version 21.0 +============ + +*Released 2024-03-06* + +This is the technical changelog for version 21.0. More elaborate release notes can be found in the news channel `@pythontelegrambotchannel `__. + +Major Changes +------------- + +- Remove Functionality Deprecated in API 7.0 (:pr:`4114` closes :issue:`4099`) +- API 7.1 (:pr:`4118`) + +New Features +------------ + +- Add Parameter ``media_write_timeout`` to ``HTTPXRequest`` and Method ``ApplicationBuilder.media_write_timeout`` (:pr:`4120` closes :issue:`3864`) +- Handle Properties in ``TelegramObject.__setstate__`` (:pr:`4134` closes :issue:`4111`) + +Bug Fixes +--------- + +- Add Missing Slot to ``Updater`` (:pr:`4130` closes :issue:`4127`) + +Documentation Improvements +-------------------------- + +- Improve HTML Download of Documentation (:pr:`4146` closes :issue:`4050`) +- Documentation Improvements (:pr:`4109`, :issue:`4116`) +- Update Copyright to 2024 (:pr:`4121` by `@aelkheir `__ closes :issue:`4041`) + +Internal Changes +---------------- + +- Apply ``pre-commit`` Checks More Widely (:pr:`4135`) +- Refactor and Overhaul ``test_official`` (:pr:`4087` closes :issue:`3874`) +- Run Unit Tests in PRs on Requirements Changes (:pr:`4144`) +- Make ``Updater.stop`` Independent of ``CancelledError`` (:pr:`4126`) + +Dependency Updates +------------------ + +- Relax Upper Bound for ``httpx`` Dependency (:pr:`4148`) +- Bump ``test-summary/action`` from 2.2 to 2.3 (:pr:`4142`) +- Update ``cachetools`` requirement from ~=5.3.2 to ~=5.3.3 (:pr:`4141`) +- Update ``httpx`` requirement from ~=0.26.0 to ~=0.27.0 (:pr:`4131`) + + Version 20.8 ============ diff --git a/docs/source/conf.py b/docs/source/conf.py index c890a4af4..055dc6e75 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -20,9 +20,9 @@ author = "Leandro Toledo" # built documents. # # The short X.Y version. -version = "20.8" # telegram.__version__[:3] +version = "21.0" # telegram.__version__[:3] # The full version, including alpha/beta/rc tags. -release = "20.8" # telegram.__version__ +release = "21.0" # telegram.__version__ # If your documentation needs a minimal Sphinx version, state it here. needs_sphinx = "6.1.3" diff --git a/telegram/_bot.py b/telegram/_bot.py index be9c971af..df498eb7a 100644 --- a/telegram/_bot.py +++ b/telegram/_bot.py @@ -977,7 +977,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| reply_to_message_id (:obj:`int`, optional): |reply_to_msg_id| Mutually exclusive with :paramref:`reply_parameters`, which this is a convenience @@ -986,7 +986,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| disable_web_page_preview (:obj:`bool`, optional): Disables link previews for links in this message. Convenience parameter for setting :paramref:`link_preview_options`. @@ -997,7 +997,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): argument. PTB will automatically convert this argument to that one, but for advanced options, please use :paramref:`link_preview_options` directly. - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| Returns: @@ -1345,7 +1345,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| reply_to_message_id (:obj:`int`, optional): |reply_to_msg_id| Mutually exclusive with :paramref:`reply_parameters`, which this is a convenience @@ -1354,7 +1354,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| filename (:obj:`str`, optional): Custom file name for the photo, when uploading a new file. Convenience parameter, useful e.g. when sending files generated by the @@ -1490,7 +1490,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| reply_to_message_id (:obj:`int`, optional): |reply_to_msg_id| Mutually exclusive with :paramref:`reply_parameters`, which this is a convenience @@ -1499,7 +1499,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| filename (:obj:`str`, optional): Custom file name for the audio, when uploading a new file. Convenience parameter, useful e.g. when sending files generated by the @@ -1635,7 +1635,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| reply_to_message_id (:obj:`int`, optional): |reply_to_msg_id| Mutually exclusive with :paramref:`reply_parameters`, which this is a convenience @@ -1644,7 +1644,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| filename (:obj:`str`, optional): Custom file name for the document, when uploading a new file. Convenience parameter, useful e.g. when sending files generated by the @@ -1752,7 +1752,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| reply_to_message_id (:obj:`int`, optional): |reply_to_msg_id| Mutually exclusive with :paramref:`reply_parameters`, which this is a convenience @@ -1761,7 +1761,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| Returns: @@ -1898,7 +1898,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| reply_to_message_id (:obj:`int`, optional): |reply_to_msg_id| Mutually exclusive with :paramref:`reply_parameters`, which this is a convenience @@ -1907,7 +1907,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| filename (:obj:`str`, optional): Custom file name for the video, when uploading a new file. Convenience parameter, useful e.g. when sending files generated by the @@ -2037,7 +2037,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| reply_to_message_id (:obj:`int`, optional): |reply_to_msg_id| Mutually exclusive with :paramref:`reply_parameters`, which this is a convenience @@ -2046,7 +2046,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| filename (:obj:`str`, optional): Custom file name for the video note, when uploading a new file. Convenience parameter, useful e.g. when sending files generated by the @@ -2184,7 +2184,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| reply_to_message_id (:obj:`int`, optional): |reply_to_msg_id| Mutually exclusive with :paramref:`reply_parameters`, which this is a convenience @@ -2193,7 +2193,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| filename (:obj:`str`, optional): Custom file name for the animation, when uploading a new file. Convenience parameter, useful e.g. when sending files generated by the @@ -2325,7 +2325,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| reply_to_message_id (:obj:`int`, optional): |reply_to_msg_id| Mutually exclusive with :paramref:`reply_parameters`, which this is a convenience @@ -2334,7 +2334,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| filename (:obj:`str`, optional): Custom file name for the voice, when uploading a new file. Convenience parameter, useful e.g. when sending files generated by the @@ -2442,7 +2442,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| reply_to_message_id (:obj:`int`, optional): |reply_to_msg_id| Mutually exclusive with :paramref:`reply_parameters`, which this is a convenience @@ -2451,7 +2451,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| caption (:obj:`str`, optional): Caption that will be added to the first element of :paramref:`media`, so that it will be used as caption for the @@ -2614,7 +2614,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| reply_to_message_id (:obj:`int`, optional): |reply_to_msg_id| Mutually exclusive with :paramref:`reply_parameters`, which this is a convenience @@ -2623,7 +2623,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| location (:class:`telegram.Location`, optional): The location to send. @@ -2893,7 +2893,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| reply_to_message_id (:obj:`int`, optional): |reply_to_msg_id| Mutually exclusive with :paramref:`reply_parameters`, which this is a convenience @@ -2902,7 +2902,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| venue (:class:`telegram.Venue`, optional): The venue to send. @@ -3026,7 +3026,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| reply_to_message_id (:obj:`int`, optional): |reply_to_msg_id| Mutually exclusive with :paramref:`reply_parameters`, which this is a convenience @@ -3035,7 +3035,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| contact (:class:`telegram.Contact`, optional): The contact to send. @@ -3137,7 +3137,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| reply_to_message_id (:obj:`int`, optional): |reply_to_msg_id| Mutually exclusive with :paramref:`reply_parameters`, which this is a convenience @@ -3146,7 +3146,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| Returns: @@ -3853,7 +3853,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): argument. PTB will automatically convert this argument to that one, but for advanced options, please use :paramref:`link_preview_options` directly. - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| @@ -4916,7 +4916,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| reply_to_message_id (:obj:`int`, optional): |reply_to_msg_id| Mutually exclusive with :paramref:`reply_parameters`, which this is a convenience @@ -4925,7 +4925,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| Returns: @@ -6906,7 +6906,7 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified. .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| reply_to_message_id (:obj:`int`, optional): |reply_to_msg_id| Mutually exclusive with :paramref:`reply_parameters`, which this is a convenience @@ -6915,7 +6915,7 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified. .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| Returns: @@ -7066,7 +7066,7 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified. .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| reply_to_message_id (:obj:`int`, optional): |reply_to_msg_id| Mutually exclusive with :paramref:`reply_parameters`, which this is a convenience @@ -7075,7 +7075,7 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified. .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| @@ -7491,7 +7491,7 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified. .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| reply_to_message_id (:obj:`int`, optional): |reply_to_msg_id| Mutually exclusive with :paramref:`reply_parameters`, which this is a convenience @@ -7500,7 +7500,7 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified. .. versionchanged:: 20.8 Bot API 7.0 introduced :paramref:`reply_parameters` |rtm_aswr_deprecated| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| Returns: diff --git a/telegram/_chat.py b/telegram/_chat.py index 8115c6056..c304be02d 100644 --- a/telegram/_chat.py +++ b/telegram/_chat.py @@ -223,12 +223,12 @@ class Chat(TelegramObject): boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. Returned only in :meth:`telegram.Bot.get_chat`. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.0 custom_emoji_sticker_set_name (:obj:`str`, optional): For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. Returned only in :meth:`telegram.Bot.get_chat`. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.0 Attributes: id (:obj:`int`): Unique identifier for this chat. This number may be greater than 32 bits @@ -366,12 +366,12 @@ class Chat(TelegramObject): boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. Returned only in :meth:`telegram.Bot.get_chat`. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.0 custom_emoji_sticker_set_name (:obj:`str`): Optional. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. Returned only in :meth:`telegram.Bot.get_chat`. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.0 .. _topics: https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups .. _accent colors: https://core.telegram.org/bots/api#accent-colors diff --git a/telegram/_chatadministratorrights.py b/telegram/_chatadministratorrights.py index f5bbb7e56..fd6e45596 100644 --- a/telegram/_chatadministratorrights.py +++ b/telegram/_chatadministratorrights.py @@ -73,19 +73,19 @@ class ChatAdministratorRights(TelegramObject): stories to the chat. .. versionadded:: 20.6 - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |non_optional_story_argument| can_edit_stories (:obj:`bool`): :obj:`True`, if the administrator can edit stories posted by other users. .. versionadded:: 20.6 - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |non_optional_story_argument| can_delete_stories (:obj:`bool`): :obj:`True`, if the administrator can delete stories posted by other users. .. versionadded:: 20.6 - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |non_optional_story_argument| can_manage_topics (:obj:`bool`, optional): :obj:`True`, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only. @@ -121,19 +121,19 @@ class ChatAdministratorRights(TelegramObject): stories to the chat. .. versionadded:: 20.6 - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |non_optional_story_argument| can_edit_stories (:obj:`bool`): :obj:`True`, if the administrator can edit stories posted by other users. .. versionadded:: 20.6 - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |non_optional_story_argument| can_delete_stories (:obj:`bool`): :obj:`True`, if the administrator can delete stories posted by other users. .. versionadded:: 20.6 - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |non_optional_story_argument| can_manage_topics (:obj:`bool`): Optional. :obj:`True`, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only. @@ -192,7 +192,7 @@ class ChatAdministratorRights(TelegramObject): # Not actually optionals but because of backwards compatability we pretend they are if can_post_stories is None or can_edit_stories is None or can_delete_stories is None: raise TypeError( - "As of vNEXT.VERSION can_post_stories, can_edit_stories and can_delete_stories" + "As of v21.0 can_post_stories, can_edit_stories and can_delete_stories" " must be set in order to create this object." ) self.can_post_stories: bool = can_post_stories diff --git a/telegram/_chatboost.py b/telegram/_chatboost.py index f16cf9db0..cb7010a3c 100644 --- a/telegram/_chatboost.py +++ b/telegram/_chatboost.py @@ -42,7 +42,7 @@ class ChatBoostAdded(TelegramObject): Two objects of this class are considered equal, if their :attr:`boost_count` are equal. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.0 Args: boost_count (:obj:`int`): Number of boosts added by the user. diff --git a/telegram/_chatmember.py b/telegram/_chatmember.py index c251e23c6..b42866b3a 100644 --- a/telegram/_chatmember.py +++ b/telegram/_chatmember.py @@ -228,19 +228,19 @@ class ChatMemberAdministrator(ChatMember): stories to the chat. .. versionadded:: 20.6 - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |non_optional_story_argument| can_edit_stories (:obj:`bool`): :obj:`True`, if the administrator can edit stories posted by other users. .. versionadded:: 20.6 - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |non_optional_story_argument| can_delete_stories (:obj:`bool`): :obj:`True`, if the administrator can delete stories posted by other users. .. versionadded:: 20.6 - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |non_optional_story_argument| can_manage_topics (:obj:`bool`, optional): :obj:`True`, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only. @@ -287,19 +287,19 @@ class ChatMemberAdministrator(ChatMember): stories to the chat. .. versionadded:: 20.6 - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |non_optional_story_argument| can_edit_stories (:obj:`bool`): :obj:`True`, if the administrator can edit stories posted by other users. .. versionadded:: 20.6 - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |non_optional_story_argument| can_delete_stories (:obj:`bool`): :obj:`True`, if the administrator can delete stories posted by other users. .. versionadded:: 20.6 - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |non_optional_story_argument| can_manage_topics (:obj:`bool`): Optional. :obj:`True`, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only @@ -365,7 +365,7 @@ class ChatMemberAdministrator(ChatMember): # Not actually optionals but because of backwards compatability we pretend they are if can_post_stories is None or can_edit_stories is None or can_delete_stories is None: raise TypeError( - "As of NEXT.VERSION can_post_stories, can_edit_stories and can_delete_stories " + "As of 21.0 can_post_stories, can_edit_stories and can_delete_stories " "must be set in order to create this object." ) self.can_post_stories: bool = can_post_stories diff --git a/telegram/_inline/inputtextmessagecontent.py b/telegram/_inline/inputtextmessagecontent.py index 711393da7..0e127ce70 100644 --- a/telegram/_inline/inputtextmessagecontent.py +++ b/telegram/_inline/inputtextmessagecontent.py @@ -66,7 +66,7 @@ class InputTextMessageContent(InputMessageContent): argument. PTB will automatically convert this argument to that one, but for advanced options, please use :paramref:`link_preview_options` directly. - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 |keyword_only_arg| Attributes: diff --git a/telegram/_keyboardbutton.py b/telegram/_keyboardbutton.py index 1f0ae3529..ad69a1761 100644 --- a/telegram/_keyboardbutton.py +++ b/telegram/_keyboardbutton.py @@ -52,7 +52,7 @@ class KeyboardButton(TelegramObject): versions released after 3 February, 2023. Older clients will display unsupported message. - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 Removed deprecated argument and attribute ``request_user``. .. versionchanged:: 20.0 :attr:`web_app` is considered as well when comparing objects of this type in terms of diff --git a/telegram/_message.py b/telegram/_message.py index c8662a121..eac0c7484 100644 --- a/telegram/_message.py +++ b/telegram/_message.py @@ -121,7 +121,7 @@ class MaybeInaccessibleMessage(TelegramObject): Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`message_id` and :attr:`chat` are equal - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 ``__bool__`` is no longer overriden and defaults to Pythons standard implementation. .. versionadded:: 20.8 @@ -244,7 +244,7 @@ class Message(MaybeInaccessibleMessage): Note: In Python :keyword:`from` is a reserved word. Use :paramref:`from_user` instead. - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 Removed deprecated arguments and attributes ``user_shared``, ``forward_from``, ``forward_from_chat``, ``forward_from_message_id``, ``forward_signature``, ``forward_sender_name`` and ``forward_date``. @@ -525,15 +525,15 @@ class Message(MaybeInaccessibleMessage): reply_to_story (:class:`telegram.Story`, optional): For replies to a story, the original story. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.0 boost_added (:class:`telegram.ChatBoostAdded`, optional): Service message: user boosted the chat. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.0 sender_boost_count (:obj:`int`, optional): If the sender of the message boosted the chat, the number of boosts added by the user. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.0 Attributes: message_id (:obj:`int`): Unique message identifier inside this chat. @@ -807,15 +807,15 @@ class Message(MaybeInaccessibleMessage): reply_to_story (:class:`telegram.Story`): Optional. For replies to a story, the original story. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.0 boost_added (:class:`telegram.ChatBoostAdded`): Optional. Service message: user boosted the chat. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.0 sender_boost_count (:obj:`int`): Optional. If the sender of the message boosted the chat, the number of boosts added by the user. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.0 .. |custom_emoji_no_md1_support| replace:: Since custom emoji entities are not supported by :attr:`~telegram.constants.ParseMode.MARKDOWN`, this method now raises a diff --git a/telegram/_story.py b/telegram/_story.py index 42e4ae06d..4cb4a8454 100644 --- a/telegram/_story.py +++ b/telegram/_story.py @@ -37,7 +37,7 @@ class Story(TelegramObject): .. versionadded:: 20.5 - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 Added attributes :attr:`chat` and :attr:`id` and equality based on them. Args: diff --git a/telegram/_version.py b/telegram/_version.py index 89211499c..3d5edbd99 100644 --- a/telegram/_version.py +++ b/telegram/_version.py @@ -51,7 +51,7 @@ class Version(NamedTuple): __version_info__: Final[Version] = Version( - major=20, minor=8, micro=0, releaselevel="final", serial=0 + major=21, minor=0, micro=0, releaselevel="final", serial=0 ) __version__: Final[str] = str(__version_info__) diff --git a/telegram/constants.py b/telegram/constants.py index ec5723d33..959e99ac4 100644 --- a/telegram/constants.py +++ b/telegram/constants.py @@ -1708,7 +1708,7 @@ class MessageType(StringEnum): BOOST_ADDED = "boost_added" """:obj:`str`: Messages with :attr:`telegram.Message.boost_added`. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.0 """ CHANNEL_CHAT_CREATED = "channel_chat_created" """:obj:`str`: Messages with :attr:`telegram.Message.channel_chat_created`.""" @@ -1810,12 +1810,12 @@ class MessageType(StringEnum): REPLY_TO_STORY = "reply_to_story" """:obj:`str`: Messages with :attr:`telegram.Message.reply_to_story`. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.0 """ SENDER_BOOST_COUNT = "sender_boost_count" """:obj:`str`: Messages with :attr:`telegram.Message.sender_boost_count`. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.0 """ STICKER = "sticker" """:obj:`str`: Messages with :attr:`telegram.Message.sticker`.""" diff --git a/telegram/ext/_applicationbuilder.py b/telegram/ext/_applicationbuilder.py index 106c73462..783a49858 100644 --- a/telegram/ext/_applicationbuilder.py +++ b/telegram/ext/_applicationbuilder.py @@ -635,7 +635,7 @@ class ApplicationBuilder(Generic[BT, CCT, UD, CD, BD, JQ]): :paramref:`~telegram.request.HTTPXRequest.media_write_timeout` parameter of :attr:`telegram.Bot.request`. Defaults to ``20``. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.0 Args: media_write_timeout (:obj:`float`): See diff --git a/telegram/ext/filters.py b/telegram/ext/filters.py index 9754569dc..aad3ad95d 100644 --- a/telegram/ext/filters.py +++ b/telegram/ext/filters.py @@ -2158,7 +2158,7 @@ class StatusUpdate: This will only catch the legacy ``user_shared`` field, not the new :attr:`telegram.Message.users_shared` attribute! - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.0 Now relies on :attr:`telegram.TelegramObject.api_kwargs` as the native attribute ``Message.user_shared`` was removed. diff --git a/telegram/request/_httpxrequest.py b/telegram/request/_httpxrequest.py index 8c18d0630..626cce830 100644 --- a/telegram/request/_httpxrequest.py +++ b/telegram/request/_httpxrequest.py @@ -121,7 +121,7 @@ class HTTPXRequest(BaseRequest): different value is passed to :paramref:`do_request.write_timeout` of :meth:`do_request`. Defaults to ``20`` seconds. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.0 """ diff --git a/tests/test_official/exceptions.py b/tests/test_official/exceptions.py index 6f83e9ca7..edb1ed2ab 100644 --- a/tests/test_official/exceptions.py +++ b/tests/test_official/exceptions.py @@ -132,7 +132,7 @@ def ptb_extra_params(object_name: str) -> set[str]: # Mostly due to the value being fixed anyway PTB_IGNORED_PARAMS = { r"InlineQueryResult\w+": {"type"}, - # TODO: Remove this in vNEXT.VERSION (API 7.1) when this can stop being optional + # TODO: Remove this in v21.0 (API 7.1) when this can stop being optional r"ChatAdministratorRights": {"can_post_stories", "can_edit_stories", "can_delete_stories"}, r"ChatMemberAdministrator": {"can_post_stories", "can_edit_stories", "can_delete_stories"}, r"ChatMember\w+": {"status"}, @@ -170,7 +170,7 @@ def ignored_param_requirements(object_name: str) -> set[str]: # Arguments that are optional arguments for now for backwards compatibility BACKWARDS_COMPAT_KWARGS: dict[str, set[str]] = { - # TODO: Remove this in vNEXT.VERSION (API 7.1) when this can stop being optional + # TODO: Remove this in v21.0 (API 7.1) when this can stop being optional r"ChatAdministratorRights": {"can_post_stories", "can_edit_stories", "can_delete_stories"}, r"ChatMemberAdministrator": {"can_post_stories", "can_edit_stories", "can_delete_stories"}, }