Bump version to v21.0

This commit is contained in:
Hinrich Mahler 2024-03-06 21:09:47 +01:00
parent ae2858783a
commit 22eb434a62
17 changed files with 127 additions and 79 deletions

View file

@ -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 <https://t.me/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 <https://github.com/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
============

View file

@ -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"

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -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.

View file

@ -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

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -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__)

View file

@ -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`."""

View file

@ -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

View file

@ -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.

View file

@ -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
"""

View file

@ -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"},
}