diff --git a/CHANGES.rst b/CHANGES.rst index 91e0eb8f0..9a509ab48 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,58 @@ Changelog ========= +Version 21.2 +============ + +*Released 2024-05-20* + +This is the technical changelog for version 21.2. More elaborate release notes can be found in the news channel `@pythontelegrambotchannel `_. + +Major Changes +------------- + +- Full Support for Bot API 7.3 (:pr:`4246`, :pr:`4260`, :pr:`4243`, :pr:`4248`, :pr:`4242` closes :issue:`4236`, :pr:`4247` by `aelkheir `_) +- Remove Functionality Deprecated by Bot API 7.2 (:pr:`4245`) + +New Features +------------ + +- Add Version to ``PTBDeprecationWarning`` (:pr:`4262` closes :issue:`4261`) +- Handle Exceptions in building ``CallbackContext`` (:pr:`4222`) + +Bug Fixes +--------- + +- Call ``Application.post_stop`` Only if ``Application.stop`` was called (:pr:`4211` closes :issue:`4210`) +- Handle ``SystemExit`` raised in Handlers (:pr:`4157` closes :issue:`4155` and :issue:`4156`) +- Make ``Birthdate.to_date`` Return a ``datetime.date`` Object (:pr:`4251`) + +Documentation Improvements +-------------------------- + +- Documentation Improvements (:pr:`4217`) + +Internal Changes +---------------- + +- Add New Rules to ``ruff`` Config (:pr:`4250`) +- Adapt Test Suite to Changes in Error Messages (:pr:`4238`) + +Dependency Updates +------------------ + +- Bump ``furo`` from 2024.4.27 to 2024.5.6 (:pr:`4252`) +- ``pre-commit`` autoupdate (:pr:`4239`) +- Bump ``pytest`` from 8.1.1 to 8.2.0 (:pr:`4231`) +- Bump ``dependabot/fetch-metadata`` from 2.0.0 to 2.1.0 (:pr:`4228`) +- Bump ``pytest-asyncio`` from 0.21.1 to 0.21.2 (:pr:`4232`) +- Bump ``pytest-xdist`` from 3.6.0 to 3.6.1 (:pr:`4233`) +- Bump ``furo`` from 2024.1.29 to 2024.4.27 (:pr:`4230`) +- Bump ``srvaroa/labeler`` from 1.10.0 to 1.10.1 (:pr:`4227`) +- Bump ``pytest`` from 7.4.4 to 8.1.1 (:pr:`4218`) +- Bump ``sphinx`` from 7.2.6 to 7.3.7 (:pr:`4215`) +- Bump ``pytest-xdist`` from 3.5.0 to 3.6.0 (:pr:`4215`) + Version 21.1.1 ============== diff --git a/docs/source/conf.py b/docs/source/conf.py index 66dfdcac0..a50e3dbdb 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 = "21.1.1" # telegram.__version__[:3] +version = "21.2" # telegram.__version__[:3] # The full version, including alpha/beta/rc tags. -release = "21.1.1" # telegram.__version__ +release = "21.2" # telegram.__version__ # If your documentation needs a minimal Sphinx version, state it here. needs_sphinx = "6.1.3" diff --git a/docs/source/telegram.backgroundfill.rst b/docs/source/telegram.backgroundfill.rst index df9310e7a..0c7c03cb7 100644 --- a/docs/source/telegram.backgroundfill.rst +++ b/docs/source/telegram.backgroundfill.rst @@ -1,7 +1,7 @@ BackgroundFill ============== -.. versionadded:: NEXT.VERSION +.. versionadded:: 21.2 .. autoclass:: telegram.BackgroundFill :members: diff --git a/docs/source/telegram.backgroundfillfreeformgradient.rst b/docs/source/telegram.backgroundfillfreeformgradient.rst index 24ddffb70..663c15e81 100644 --- a/docs/source/telegram.backgroundfillfreeformgradient.rst +++ b/docs/source/telegram.backgroundfillfreeformgradient.rst @@ -1,7 +1,7 @@ BackgroundFillFreeformGradient ============================== -.. versionadded:: NEXT.VERSION +.. versionadded:: 21.2 .. autoclass:: telegram.BackgroundFillFreeformGradient :members: diff --git a/docs/source/telegram.backgroundfillgradient.rst b/docs/source/telegram.backgroundfillgradient.rst index 9955c6f1d..313d4bd64 100644 --- a/docs/source/telegram.backgroundfillgradient.rst +++ b/docs/source/telegram.backgroundfillgradient.rst @@ -1,7 +1,7 @@ BackgroundFillGradient ====================== -.. versionadded:: NEXT.VERSION +.. versionadded:: 21.2 .. autoclass:: telegram.BackgroundFillGradient :members: diff --git a/docs/source/telegram.backgroundfillsolid.rst b/docs/source/telegram.backgroundfillsolid.rst index 27be28d52..5130de5f9 100644 --- a/docs/source/telegram.backgroundfillsolid.rst +++ b/docs/source/telegram.backgroundfillsolid.rst @@ -1,7 +1,7 @@ BackgroundFillSolid =================== -.. versionadded:: NEXT.VERSION +.. versionadded:: 21.2 .. autoclass:: telegram.BackgroundFillSolid :members: diff --git a/docs/source/telegram.backgroundtype.rst b/docs/source/telegram.backgroundtype.rst index f890ca12d..08e9dc022 100644 --- a/docs/source/telegram.backgroundtype.rst +++ b/docs/source/telegram.backgroundtype.rst @@ -1,7 +1,7 @@ BackgroundType ============== -.. versionadded:: NEXT.VERSION +.. versionadded:: 21.2 .. autoclass:: telegram.BackgroundType :members: diff --git a/docs/source/telegram.backgroundtypechattheme.rst b/docs/source/telegram.backgroundtypechattheme.rst index d192d4aae..1d26bde20 100644 --- a/docs/source/telegram.backgroundtypechattheme.rst +++ b/docs/source/telegram.backgroundtypechattheme.rst @@ -1,7 +1,7 @@ BackgroundTypeChatTheme ======================= -.. versionadded:: NEXT.VERSION +.. versionadded:: 21.2 .. autoclass:: telegram.BackgroundTypeChatTheme :members: diff --git a/docs/source/telegram.backgroundtypefill.rst b/docs/source/telegram.backgroundtypefill.rst index 5c0373c4e..636ff3d7e 100644 --- a/docs/source/telegram.backgroundtypefill.rst +++ b/docs/source/telegram.backgroundtypefill.rst @@ -1,7 +1,7 @@ BackgroundTypeFill ================== -.. versionadded:: NEXT.VERSION +.. versionadded:: 21.2 .. autoclass:: telegram.BackgroundTypeFill :members: diff --git a/docs/source/telegram.backgroundtypepattern.rst b/docs/source/telegram.backgroundtypepattern.rst index 763a6e69c..7b14d52bf 100644 --- a/docs/source/telegram.backgroundtypepattern.rst +++ b/docs/source/telegram.backgroundtypepattern.rst @@ -1,7 +1,7 @@ BackgroundTypePattern ===================== -.. versionadded:: NEXT.VERSION +.. versionadded:: 21.2 .. autoclass:: telegram.BackgroundTypePattern :members: diff --git a/docs/source/telegram.backgroundtypewallpaper.rst b/docs/source/telegram.backgroundtypewallpaper.rst index 3852cdab5..143c04255 100644 --- a/docs/source/telegram.backgroundtypewallpaper.rst +++ b/docs/source/telegram.backgroundtypewallpaper.rst @@ -1,7 +1,7 @@ BackgroundTypeWallpaper ======================= -.. versionadded:: NEXT.VERSION +.. versionadded:: 21.2 .. autoclass:: telegram.BackgroundTypeWallpaper :members: diff --git a/docs/source/telegram.chatbackground.rst b/docs/source/telegram.chatbackground.rst index 07e28d78b..6f43b27fb 100644 --- a/docs/source/telegram.chatbackground.rst +++ b/docs/source/telegram.chatbackground.rst @@ -1,7 +1,7 @@ ChatBackground ============== -.. versionadded:: NEXT.VERSION +.. versionadded:: 21.2 .. autoclass:: telegram.ChatBackground :members: diff --git a/telegram/_birthdate.py b/telegram/_birthdate.py index 8d88b3036..06caf67d5 100644 --- a/telegram/_birthdate.py +++ b/telegram/_birthdate.py @@ -73,7 +73,7 @@ class Birthdate(TelegramObject): def to_date(self, year: Optional[int] = None) -> date: """Return the birthdate as a date object. - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.2 Now returns a :obj:`datetime.date` object instead of a :obj:`datetime.datetime` object, as was originally intended. diff --git a/telegram/_bot.py b/telegram/_bot.py index 799c5238e..cf08284c7 100644 --- a/telegram/_bot.py +++ b/telegram/_bot.py @@ -2772,7 +2772,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): date must remain within the next 90 days. If not specified, then ``live_period`` remains unchanged - .. versionadded:: NEXT.VERSION. + .. versionadded:: 21.2. Keyword Args: location (:class:`telegram.Location`, optional): The location to send. @@ -4457,7 +4457,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.2 In accordance to Bot API 7.3, this method now returns a :class:`telegram.ChatFullInfo`. Args: @@ -6360,7 +6360,7 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified. Removed the deprecated parameters mentioned above and adjusted the order of the parameters. - .. versionremoved:: NEXT.VERSION + .. versionremoved:: 21.2 Removed the deprecated parameter ``sticker_format``. Args: @@ -6867,7 +6867,7 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified. .. versionchanged:: 20.0 |sequenceargs| - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.2 Bot API 7.3 adds support for :class:`~telegram.InputPollOption` objects. is_anonymous (:obj:`bool`, optional): :obj:`True`, if the poll needs to be anonymous, defaults to :obj:`True`. @@ -6927,12 +6927,12 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified. See the constants in :class:`telegram.constants.ParseMode` for the available modes. Currently, only custom emoji entities are allowed. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 question_entities (Sequence[:class:`telegram.Message`], optional): Special entities that appear in the poll :paramref:`question`. It can be specified instead of :paramref:`question_parse_mode`. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Keyword Args: allow_sending_without_reply (:obj:`bool`, optional): |allow_sending_without_reply| diff --git a/telegram/_chat.py b/telegram/_chat.py index f19a8e21e..b94d006e1 100644 --- a/telegram/_chat.py +++ b/telegram/_chat.py @@ -150,13 +150,13 @@ class Chat(TelegramObject): photo (:class:`telegram.ChatPhoto`, optional): Chat photo. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. bio (:obj:`str`, optional): Bio of the other party in a private chat. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. has_private_forwards (:obj:`bool`, optional): :obj:`True`, if privacy settings of the other @@ -165,38 +165,38 @@ class Chat(TelegramObject): .. versionadded:: 13.9 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. description (:obj:`str`, optional): Description, for groups, supergroups and channel chats. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. invite_link (:obj:`str`, optional): Primary invite link, for groups, supergroups and channel. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. pinned_message (:class:`telegram.Message`, optional): The most recent pinned message (by sending date). Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. permissions (:class:`telegram.ChatPermissions`): Optional. Default chat member permissions, for groups and supergroups. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. slow_mode_delay (:obj:`int`, optional): For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. message_auto_delete_time (:obj:`int`, optional): The time after which all messages sent to @@ -205,7 +205,7 @@ class Chat(TelegramObject): .. versionadded:: 13.4 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. has_protected_content (:obj:`bool`, optional): :obj:`True`, if messages from the chat can't @@ -213,7 +213,7 @@ class Chat(TelegramObject): .. versionadded:: 13.9 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. has_visible_history (:obj:`bool`, optional): :obj:`True`, if new chat members will have @@ -222,32 +222,32 @@ class Chat(TelegramObject): .. versionadded:: 20.8 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. sticker_set_name (:obj:`str`, optional): For supergroups, name of group sticker set. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. can_set_sticker_set (:obj:`bool`, optional): :obj:`True`, if the bot can change group the sticker set. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. linked_chat_id (:obj:`int`, optional): Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. location (:class:`telegram.ChatLocation`, optional): For supergroups, the location to which the supergroup is connected. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. join_to_send_messages (:obj:`bool`, optional): :obj:`True`, if users need to join the @@ -256,7 +256,7 @@ class Chat(TelegramObject): .. versionadded:: 20.0 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. join_by_request (:obj:`bool`, optional): :obj:`True`, if all users directly joining the @@ -265,7 +265,7 @@ class Chat(TelegramObject): .. versionadded:: 20.0 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. has_restricted_voice_and_video_messages (:obj:`bool`, optional): :obj:`True`, if the @@ -274,7 +274,7 @@ class Chat(TelegramObject): .. versionadded:: 20.0 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. is_forum (:obj:`bool`, optional): :obj:`True`, if the supergroup chat is a forum @@ -288,7 +288,7 @@ class Chat(TelegramObject): .. versionadded:: 20.0 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. business_intro (:class:`telegram.BusinessIntro`, optional): For private chats with @@ -297,7 +297,7 @@ class Chat(TelegramObject): .. versionadded:: 21.1 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. business_location (:class:`telegram.BusinessLocation`, optional): For private chats with @@ -306,7 +306,7 @@ class Chat(TelegramObject): .. versionadded:: 21.1 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. business_opening_hours (:class:`telegram.BusinessOpeningHours`, optional): For private @@ -315,7 +315,7 @@ class Chat(TelegramObject): .. versionadded:: 21.1 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. available_reactions (Sequence[:class:`telegram.ReactionType`], optional): List of available @@ -325,7 +325,7 @@ class Chat(TelegramObject): .. versionadded:: 20.8 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. accent_color_id (:obj:`int`, optional): Identifier of the @@ -336,7 +336,7 @@ class Chat(TelegramObject): .. versionadded:: 20.8 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. background_custom_emoji_id (:obj:`str`, optional): Custom emoji identifier of emoji chosen @@ -345,7 +345,7 @@ class Chat(TelegramObject): .. versionadded:: 20.8 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. profile_accent_color_id (:obj:`int`, optional): Identifier of the @@ -355,7 +355,7 @@ class Chat(TelegramObject): .. versionadded:: 20.8 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. profile_background_custom_emoji_id (:obj:`str`, optional): Custom emoji identifier of @@ -364,7 +364,7 @@ class Chat(TelegramObject): .. versionadded:: 20.8 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. emoji_status_custom_emoji_id (:obj:`str`, optional): Custom emoji identifier of emoji @@ -373,7 +373,7 @@ class Chat(TelegramObject): .. versionadded:: 20.0 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. emoji_status_expiration_date (:class:`datetime.datetime`, optional): Expiration date of @@ -383,7 +383,7 @@ class Chat(TelegramObject): .. versionadded:: 20.5 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. has_aggressive_anti_spam_enabled (:obj:`bool`, optional): :obj:`True`, if aggressive @@ -392,7 +392,7 @@ class Chat(TelegramObject): .. versionadded:: 20.0 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. has_hidden_members (:obj:`bool`, optional): :obj:`True`, if non-administrators can only @@ -401,7 +401,7 @@ class Chat(TelegramObject): .. versionadded:: 20.0 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. unrestrict_boost_count (:obj:`int`, optional): For supergroups, the minimum number of @@ -410,7 +410,7 @@ class Chat(TelegramObject): .. versionadded:: 21.0 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. custom_emoji_sticker_set_name (:obj:`str`, optional): For supergroups, the name of the @@ -419,7 +419,7 @@ class Chat(TelegramObject): .. versionadded:: 21.0 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. birthdate (:obj:`telegram.Birthdate`, optional): For private chats, @@ -427,7 +427,7 @@ class Chat(TelegramObject): .. versionadded:: 21.1 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. personal_chat (:obj:`telegram.Chat`, optional): For private chats, the personal channel of @@ -435,7 +435,7 @@ class Chat(TelegramObject): .. versionadded:: 21.1 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. @@ -454,13 +454,13 @@ class Chat(TelegramObject): photo (:class:`telegram.ChatPhoto`): Optional. Chat photo. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. bio (:obj:`str`): Optional. Bio of the other party in a private chat. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. has_private_forwards (:obj:`bool`): Optional. :obj:`True`, if privacy settings of the other @@ -469,38 +469,38 @@ class Chat(TelegramObject): .. versionadded:: 13.9 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. description (:obj:`str`): Optional. Description, for groups, supergroups and channel chats. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. invite_link (:obj:`str`): Optional. Primary invite link, for groups, supergroups and channel. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. pinned_message (:class:`telegram.Message`): Optional. The most recent pinned message (by sending date). Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. permissions (:class:`telegram.ChatPermissions`): Optional. Default chat member permissions, for groups and supergroups. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. slow_mode_delay (:obj:`int`): Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. message_auto_delete_time (:obj:`int`): Optional. The time after which all messages sent to @@ -509,7 +509,7 @@ class Chat(TelegramObject): .. versionadded:: 13.4 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. has_protected_content (:obj:`bool`): Optional. :obj:`True`, if messages from the chat can't @@ -517,7 +517,7 @@ class Chat(TelegramObject): .. versionadded:: 13.9 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. has_visible_history (:obj:`bool`): Optional. :obj:`True`, if new chat members will have @@ -526,32 +526,32 @@ class Chat(TelegramObject): .. versionadded:: 20.8 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. sticker_set_name (:obj:`str`): Optional. For supergroups, name of Group sticker set. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. can_set_sticker_set (:obj:`bool`): Optional. :obj:`True`, if the bot can change group the sticker set. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. linked_chat_id (:obj:`int`): Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. location (:class:`telegram.ChatLocation`): Optional. For supergroups, the location to which the supergroup is connected. Returned only in :meth:`telegram.Bot.get_chat`. - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. join_to_send_messages (:obj:`bool`): Optional. :obj:`True`, if users need to join @@ -560,7 +560,7 @@ class Chat(TelegramObject): .. versionadded:: 20.0 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. join_by_request (:obj:`bool`): Optional. :obj:`True`, if all users directly joining the @@ -569,7 +569,7 @@ class Chat(TelegramObject): .. versionadded:: 20.0 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. has_restricted_voice_and_video_messages (:obj:`bool`): Optional. :obj:`True`, if the @@ -578,7 +578,7 @@ class Chat(TelegramObject): .. versionadded:: 20.0 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. is_forum (:obj:`bool`): Optional. :obj:`True`, if the supergroup chat is a forum @@ -594,7 +594,7 @@ class Chat(TelegramObject): .. versionadded:: 20.0 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. business_intro (:class:`telegram.BusinessIntro`): Optional. For private chats with @@ -603,7 +603,7 @@ class Chat(TelegramObject): .. versionadded:: 21.1 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. business_location (:class:`telegram.BusinessLocation`): Optional. For private chats with @@ -612,7 +612,7 @@ class Chat(TelegramObject): .. versionadded:: 21.1 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. business_opening_hours (:class:`telegram.BusinessOpeningHours`): Optional. For private @@ -621,7 +621,7 @@ class Chat(TelegramObject): .. versionadded:: 21.1 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. available_reactions (Tuple[:class:`telegram.ReactionType`]): Optional. List of available @@ -631,7 +631,7 @@ class Chat(TelegramObject): .. versionadded:: 20.8 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. accent_color_id (:obj:`int`): Optional. Identifier of the @@ -642,7 +642,7 @@ class Chat(TelegramObject): .. versionadded:: 20.8 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. background_custom_emoji_id (:obj:`str`): Optional. Custom emoji identifier of emoji chosen @@ -651,7 +651,7 @@ class Chat(TelegramObject): .. versionadded:: 20.8 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. profile_accent_color_id (:obj:`int`): Optional. Identifier of the @@ -661,7 +661,7 @@ class Chat(TelegramObject): .. versionadded:: 20.8 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. profile_background_custom_emoji_id (:obj:`str`): Optional. Custom emoji identifier of @@ -670,7 +670,7 @@ class Chat(TelegramObject): .. versionadded:: 20.8 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. emoji_status_custom_emoji_id (:obj:`str`): Optional. Custom emoji identifier of emoji @@ -679,7 +679,7 @@ class Chat(TelegramObject): .. versionadded:: 20.0 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. emoji_status_expiration_date (:class:`datetime.datetime`): Optional. Expiration date of @@ -689,7 +689,7 @@ class Chat(TelegramObject): .. versionadded:: 20.5 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. has_aggressive_anti_spam_enabled (:obj:`bool`): Optional. :obj:`True`, if aggressive @@ -698,7 +698,7 @@ class Chat(TelegramObject): .. versionadded:: 20.0 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. has_hidden_members (:obj:`bool`): Optional. :obj:`True`, if non-administrators can only @@ -707,7 +707,7 @@ class Chat(TelegramObject): .. versionadded:: 20.0 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. unrestrict_boost_count (:obj:`int`): Optional. For supergroups, the minimum number of @@ -716,7 +716,7 @@ class Chat(TelegramObject): .. versionadded:: 21.0 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. custom_emoji_sticker_set_name (:obj:`str`): Optional. For supergroups, the name of the @@ -725,7 +725,7 @@ class Chat(TelegramObject): .. versionadded:: 21.0 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. birthdate (:obj:`telegram.Birthdate`): Optional. For private chats, @@ -733,7 +733,7 @@ class Chat(TelegramObject): .. versionadded:: 21.1 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. personal_chat (:obj:`telegram.Chat`): Optional. For private chats, the personal channel of @@ -741,7 +741,7 @@ class Chat(TelegramObject): .. versionadded:: 21.1 - .. deprecated:: NEXT.VERSION + .. deprecated:: 21.2 In accordance to Bot API 7.3, this attribute will be moved to :class:`telegram.ChatFullInfo`. @@ -911,7 +911,7 @@ class Chat(TelegramObject): if (val := object.__getattribute__(self, arg)) is not None and val != (): warn( PTBDeprecationWarning( - "NEXT.VERSION", + "21.2", f"The argument `{arg}` is deprecated and will only be available via " "`ChatFullInfo` in the future.", ), @@ -926,7 +926,7 @@ class Chat(TelegramObject): if name in _deprecated_attrs and self.__class__ is Chat: warn( PTBDeprecationWarning( - "NEXT.VERSION", + "21.2", f"The attribute `{name}` is deprecated and will only be accessible via " "`ChatFullInfo` in the future.", ), diff --git a/telegram/_chatbackground.py b/telegram/_chatbackground.py index c1bf0361c..66b58c92a 100644 --- a/telegram/_chatbackground.py +++ b/telegram/_chatbackground.py @@ -40,7 +40,7 @@ class BackgroundFill(TelegramObject): Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`type` is equal. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Args: type (:obj:`str`): Type of the background fill. Can be one of: @@ -104,7 +104,7 @@ class BackgroundFillSolid(BackgroundFill): Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`color` is equal. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Args: color (:obj:`int`): The color of the background fill in the `RGB24` format. @@ -139,7 +139,7 @@ class BackgroundFillGradient(BackgroundFill): considered equal, if their :attr:`top_color`, :attr:`bottom_color` and :attr:`rotation_angle` are equal. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Args: top_color (:obj:`int`): Top color of the gradient in the `RGB24` format. @@ -186,7 +186,7 @@ class BackgroundFillFreeformGradient(BackgroundFill): Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`colors` is equal. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Args: colors (Sequence[:obj:`int`]): A list of the 3 or 4 base colors that are used to @@ -226,7 +226,7 @@ class BackgroundType(TelegramObject): Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`type` is equal. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Args: type (:obj:`str`): Type of the background. Can be one of: @@ -300,7 +300,7 @@ class BackgroundTypeFill(BackgroundType): Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`fill` and :attr:`dark_theme_dimming` are equal. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Args: fill (:obj:`telegram.BackgroundFill`): The background fill. @@ -342,7 +342,7 @@ class BackgroundTypeWallpaper(BackgroundType): Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`document` and :attr:`dark_theme_dimming` are equal. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Args: document (:obj:`telegram.Document`): Document with the wallpaper @@ -400,7 +400,7 @@ class BackgroundTypePattern(BackgroundType): Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`document` and :attr:`fill` and :attr:`intensity` are equal. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Args: document (:obj:`telegram.Document`): Document with the pattern. @@ -470,7 +470,7 @@ class BackgroundTypeChatTheme(BackgroundType): Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`theme_name` is equal. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Args: theme_name (:obj:`str`): Name of the chat theme, which is usually an emoji. @@ -504,7 +504,7 @@ class ChatBackground(TelegramObject): Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`type` is equal. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Args: type (:obj:`telegram.BackgroundType`): Type of the background. diff --git a/telegram/_chatfullinfo.py b/telegram/_chatfullinfo.py index da9e485d6..9b100830b 100644 --- a/telegram/_chatfullinfo.py +++ b/telegram/_chatfullinfo.py @@ -48,19 +48,19 @@ class ChatFullInfo(Chat): .. seealso:: All arguments and attributes can be found in :class:`telegram.Chat`. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Args: max_reaction_count (:obj:`int`): The maximum number of reactions that can be set on a message in the chat. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Attributes: max_reaction_count (:obj:`int`): The maximum number of reactions that can be set on a message in the chat. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 """ __slots__ = ("max_reaction_count",) diff --git a/telegram/_chatmemberupdated.py b/telegram/_chatmemberupdated.py index 41dbb8844..c51b88b7b 100644 --- a/telegram/_chatmemberupdated.py +++ b/telegram/_chatmemberupdated.py @@ -67,7 +67,7 @@ class ChatMemberUpdated(TelegramObject): sending a direct join request without using an invite link and being approved by an administrator - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Attributes: chat (:class:`telegram.Chat`): Chat the user belongs to. @@ -89,7 +89,7 @@ class ChatMemberUpdated(TelegramObject): sending a direct join request without using an invite link and being approved by an administrator - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 """ diff --git a/telegram/_files/sticker.py b/telegram/_files/sticker.py index 25abee0aa..b1194deee 100644 --- a/telegram/_files/sticker.py +++ b/telegram/_files/sticker.py @@ -235,7 +235,7 @@ class StickerSet(TelegramObject): .. versionchanged:: 20.5 |removed_thumb_note| - .. versionremoved:: NEXT.VERSION + .. versionremoved:: 21.2 Removed the deprecated arguments and attributes ``is_animated`` and ``is_video``. Args: diff --git a/telegram/_message.py b/telegram/_message.py index a546436f1..eaea1f3fb 100644 --- a/telegram/_message.py +++ b/telegram/_message.py @@ -559,7 +559,7 @@ class Message(MaybeInaccessibleMessage): chat_background_set (:obj:`telegram.ChatBackground`, optional): Service message: chat background set. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Attributes: message_id (:obj:`int`): Unique message identifier inside this chat. @@ -864,7 +864,7 @@ class Message(MaybeInaccessibleMessage): chat_background_set (:obj:`telegram.ChatBackground`): Optional. Service message: chat background set - .. versionadded:: Next.Version + .. versionadded:: 21.2 .. |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/_poll.py b/telegram/_poll.py index 656b7e8b8..cd6397cf7 100644 --- a/telegram/_poll.py +++ b/telegram/_poll.py @@ -43,7 +43,7 @@ class InputPollOption(TelegramObject): Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`text` is equal. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Args: text (:obj:`str`): Option text, @@ -118,7 +118,7 @@ class PollOption(TelegramObject): that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Attributes: text (:obj:`str`): Option text, @@ -130,7 +130,7 @@ class PollOption(TelegramObject): poll option texts. This list is empty if the question does not contain entities. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 """ @@ -174,7 +174,7 @@ class PollOption(TelegramObject): UTF-16 codepoint pairs, which some versions of Python don't handle automatically. (That is, you can't just slice ``Message.text`` with the offset and length.) - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Args: entity (:class:`telegram.MessageEntity`): The entity to extract the text from. It must @@ -196,7 +196,7 @@ class PollOption(TelegramObject): attribute, since it calculates the correct substring from the message text based on UTF-16 codepoints. See :attr:`parse_entity` for more info. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Args: types (List[:obj:`str`], optional): List of ``MessageEntity`` types as strings. If the @@ -362,7 +362,7 @@ class Poll(TelegramObject): that appear in the :attr:`question`. Currently, only custom emoji entities are allowed in poll questions. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Attributes: id (:obj:`str`): Unique poll identifier. @@ -404,7 +404,7 @@ class Poll(TelegramObject): in poll questions. This list is empty if the question does not contain entities. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 """ @@ -544,7 +544,7 @@ class Poll(TelegramObject): """Returns the text in :attr:`question` from a given :class:`telegram.MessageEntity` of :attr:`question_entities`. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Note: This method is present because Telegram calculates the offset and length in @@ -568,7 +568,7 @@ class Poll(TelegramObject): It contains entities from this polls question filtered by their ``type`` attribute as the key, and the text that each entity belongs to as the value of the :obj:`dict`. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Note: This method should always be used instead of the :attr:`question_entities` diff --git a/telegram/_shared.py b/telegram/_shared.py index d35bef880..8c791154e 100644 --- a/telegram/_shared.py +++ b/telegram/_shared.py @@ -44,7 +44,7 @@ class UsersShared(TelegramObject): The argument :attr:`users` is now considered for the equality comparison instead of ``user_ids``. - .. versionremoved:: NEXT.VERSION + .. versionremoved:: 21.2 Removed the deprecated argument and attribute ``user_ids``. Args: @@ -54,7 +54,7 @@ class UsersShared(TelegramObject): .. versionadded:: 21.1 - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.2 This argument is now required. Attributes: diff --git a/telegram/_utils/warnings.py b/telegram/_utils/warnings.py index f11b6f3cf..dcc3fc150 100644 --- a/telegram/_utils/warnings.py +++ b/telegram/_utils/warnings.py @@ -45,7 +45,7 @@ def warn( message (:obj:`str` | :obj:`PTBUserWarning`): Specify the warnings message to pass to ``warnings.warn()``. - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.2 Now also accepts a :obj:`PTBUserWarning` instance. category (:obj:`Type[Warning]`, optional): Specify the Warning class to pass to diff --git a/telegram/_version.py b/telegram/_version.py index bc75598cc..e1a1bbe79 100644 --- a/telegram/_version.py +++ b/telegram/_version.py @@ -51,7 +51,7 @@ class Version(NamedTuple): __version_info__: Final[Version] = Version( - major=21, minor=1, micro=1, releaselevel="final", serial=0 + major=21, minor=2, micro=0, releaselevel="final", serial=0 ) __version__: Final[str] = str(__version_info__) diff --git a/telegram/constants.py b/telegram/constants.py index a12bb08de..a2d91885c 100644 --- a/telegram/constants.py +++ b/telegram/constants.py @@ -831,7 +831,7 @@ class BackgroundTypeLimit(IntEnum): :class:`telegram.BackgroundTypeWallpaper` and :class:`telegram.BackgroundTypePattern`. The enum members of this enumeration are instances of :class:`int` and can be treated as such. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 """ __slots__ = () @@ -854,7 +854,7 @@ class BackgroundFillLimit(IntEnum): """This enum contains limitations for :class:`telegram.BackgroundFillGradient`. The enum members of this enumeration are instances of :class:`int` and can be treated as such. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 """ __slots__ = () @@ -1483,7 +1483,7 @@ class LocationLimit(IntEnum): * :paramref:`~telegram.Bot.send_location.live_period` parameter of :meth:`telegram.Bot.send_location` - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 """ MIN_PROXIMITY_ALERT_RADIUS = 1 @@ -1788,7 +1788,7 @@ class MessageType(StringEnum): CHAT_BACKGROUND_SET = "chat_background_set" """:obj:`str`: Messages with :attr:`telegram.Message.chat_background_set`. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 """ CONNECTED_WEBSITE = "connected_website" """:obj:`str`: Messages with :attr:`telegram.Message.connected_website`.""" @@ -2948,7 +2948,7 @@ class BackgroundTypeType(StringEnum): """This enum contains the available types of :class:`telegram.BackgroundType`. The enum members of this enumeration are instances of :class:`str` and can be treated as such. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 """ __slots__ = () @@ -2967,7 +2967,7 @@ class BackgroundFillType(StringEnum): """This enum contains the available types of :class:`telegram.BackgroundFill`. The enum members of this enumeration are instances of :class:`str` and can be treated as such. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 """ __slots__ = () diff --git a/telegram/ext/_application.py b/telegram/ext/_application.py index 68c058f6d..f5a9d6df4 100644 --- a/telegram/ext/_application.py +++ b/telegram/ext/_application.py @@ -733,7 +733,7 @@ class Application(Generic[BT, CCT, UD, CD, BD, JQ], AsyncContextManager["Applica .. versionadded:: 20.5 - .. versionchanged:: NEXT.VERSION + .. versionchanged:: 21.2 Added support for calling within :meth:`post_init`. """ if self.running: diff --git a/telegram/ext/_defaults.py b/telegram/ext/_defaults.py index 82ba75bf9..100d54e6e 100644 --- a/telegram/ext/_defaults.py +++ b/telegram/ext/_defaults.py @@ -273,7 +273,7 @@ class Defaults: """:obj:`str`: Optional. Alias for :attr:`parse_mode`, used for the corresponding parameter of :class:`telegram.InputPollOption`. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 """ return self._parse_mode @@ -288,7 +288,7 @@ class Defaults: """:obj:`str`: Optional. Alias for :attr:`parse_mode`, used for the corresponding parameter of :meth:`telegram.Bot.send_poll`. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 """ return self._parse_mode diff --git a/telegram/warnings.py b/telegram/warnings.py index 9eda53954..0c761b974 100644 --- a/telegram/warnings.py +++ b/telegram/warnings.py @@ -58,18 +58,18 @@ class PTBDeprecationWarning(PTBUserWarning, DeprecationWarning): Args: version (:obj:`str`): The version in which the feature was deprecated. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 message (:obj:`str`): The message to display. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 Attributes: version (:obj:`str`): The version in which the feature was deprecated. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 message (:obj:`str`): The message to display. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 """ __slots__ = ("message", "version") @@ -82,6 +82,6 @@ class PTBDeprecationWarning(PTBUserWarning, DeprecationWarning): """Returns a string representation of the warning, using :attr:`message` and :attr:`version`. - .. versionadded:: NEXT.VERSION + .. versionadded:: 21.2 """ return f"Deprecated since version {self.version}: {self.message}"