Bump Version to v20.5

This commit is contained in:
Hinrich Mahler 2023-09-03 14:46:28 +02:00
parent f9ccf560f6
commit 82c98b64a7
33 changed files with 112 additions and 61 deletions

View file

@ -4,6 +4,57 @@
Changelog
=========
Version 20.5
============
*Released 2023-09-03*
This is the technical changelog for version 20.5. More elaborate release notes can be found in the news channel `@pythontelegrambotchannel <https://t.me/pythontelegrambotchannel>`__.
Major Changes
-------------
- API 6.8 (:pr:`3853`)
- Remove Functionality Deprecated Since Bot API 6.5, 6.6 or 6.7 (:pr:`3858`)
New Features
------------
- Extend Allowed Values for HTTP Version (:pr:`3823` closes :issue:`3821`)
- Add ``has_args`` Parameter to ``CommandHandler`` (:pr:`3854` by `@thatguylah <https://github.com/thatguylah>`__ closes :issue:`3798`)
- Add ``Application.stop_running()`` and Improve Marking Updates as Read on ``Updater.stop()`` (:pr:`3804`)
Minor Changes
-------------
- Type Hinting Fixes for ``WebhookInfo`` (:pr:`3871`)
- Test and Document ``Exception.__cause__`` on ``NetworkError`` (:pr:`3792` closes :issue:`3778`)
- Add Support for Python 3.12 RC (:pr:`3847`)
Documentation Improvements
--------------------------
- Remove Version Check from Examples (:pr:`3846`)
- Documentation Improvements (:pr:`3803`, :pr:`3797`, :pr:`3816` by `@trim21 <https://github.com/trim21>`__, :pr:`3829` by `@aelkheir <https://github.com/aelkheir>`__)
- Provide Versions of ``customwebhookbot.py`` with Different Frameworks (:pr:`3820` closes :issue:`3717`)
Dependency Updates
------------------
- ``pre-commit`` autoupdate (:pr:`3824`)
- Bump ``srvaroa/labeler`` from 1.6.0 to 1.6.1 (:pr:`3870`)
- Bump ``sphinx`` from 7.0.1 to 7.1.1 (:pr:`3818`)
- Bump ``sphinx`` from 7.2.3 to 7.2.5 (:pr:`3869`)
- Bump ``furo`` from 2023.5.20 to 2023.7.26 (:pr:`3817`)
- Update ``apscheduler`` requirement from ~=3.10.3 to ~=3.10.4 (:pr:`3862`)
- Bump ``sphinx`` from 7.2.2 to 7.2.3 (:pr:`3861`)
- Bump ``pytest-asyncio`` from 0.21.0 to 0.21.1 (:pr:`3801`)
- Bump ``sphinx-paramlinks`` from 0.5.4 to 0.6.0 (:pr:`3840`)
- Update ``apscheduler`` requirement from ~=3.10.1 to ~=3.10.3 (:pr:`3851`)
- Bump ``furo`` from 2023.7.26 to 2023.8.19 (:pr:`3850`)
- Bump ``sphinx`` from 7.1.2 to 7.2.2 (:pr:`3852`)
- Bump ``sphinx`` from 7.1.1 to 7.1.2 (:pr:`3827`)
Version 20.4
============

View file

@ -21,9 +21,9 @@ author = "Leandro Toledo"
# built documents.
#
# The short X.Y version.
version = "20.4" # telegram.__version__[:3]
version = "20.5" # telegram.__version__[:3]
# The full version, including alpha/beta/rc tags.
release = "20.4" # telegram.__version__
release = "20.5" # telegram.__version__
# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = "6.1.3"

View file

@ -187,7 +187,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]):
the file path will be passed in the
`file URI scheme <https://en.wikipedia.org/wiki/File_URI_scheme>`_.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
Removed deprecated methods ``set_sticker_set_thumb`` and ``setStickerSetThumb``.
Use :meth:`set_sticker_set_thumbnail` and :meth:`setStickerSetThumbnail` instead.
@ -1109,7 +1109,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_arg|
Args:
@ -1231,7 +1231,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_arg|
Args:
@ -1446,7 +1446,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_arg|
Args:
@ -1576,7 +1576,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_arg|
Args:
@ -1695,7 +1695,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_arg|
Args:
@ -2757,7 +2757,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
Removed deprecated arguments ``switch_pm_text`` and ``switch_pm_parameter``.
Args:
@ -5493,7 +5493,7 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified.
:meth:`create_new_sticker_set` and :meth:`add_sticker_to_set` methods (can be used multiple
times).
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
Removed deprecated parameter ``png_sticker``.
Args:
@ -5561,7 +5561,7 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified.
Since Bot API 6.6, the parameter :paramref:`sticker` replace the parameters
``png_sticker``, ``tgs_sticker``, ``webm_sticker``, ``emojis``, and ``mask_position``.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
Removed deprecated parameters ``png_sticker``, ``tgs_sticker``, ``webm_sticker``,
``emojis``, and ``mask_position``.
@ -5663,7 +5663,7 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified.
replace the parameters ``png_sticker``, ``tgs_sticker``,``webm_sticker``, ``emojis``,
and ``mask_position``.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
Removed the deprecated parameters mentioned above and adjusted the order of the
parameters.
@ -7346,7 +7346,7 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified.
:paramref:`~telegram.ChatAdministratorRights.can_pin_messages` administrator rights in the
supergroup.
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.5
Args:
chat_id (:obj:`int` | :obj:`str`): |chat_id_group|

View file

@ -178,7 +178,7 @@ class Chat(TelegramObject):
:meth:`telegram.Bot.get_chat`.
|datetime_localization|
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.5
has_aggressive_anti_spam_enabled (:obj:`bool`, optional): :obj:`True`, if aggressive
anti-spam checks are enabled in the supergroup. The field is only available to chat
administrators. Returned only in :meth:`telegram.Bot.get_chat`.
@ -277,7 +277,7 @@ class Chat(TelegramObject):
:meth:`telegram.Bot.get_chat`.
|datetime_localization|
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.5
has_aggressive_anti_spam_enabled (:obj:`bool`): Optional. :obj:`True`, if aggressive
anti-spam checks are enabled in the supergroup. The field is only available to chat
administrators. Returned only in :meth:`telegram.Bot.get_chat`.
@ -2934,7 +2934,7 @@ class Chat(TelegramObject):
For the documentation of the arguments, please see
:meth:`telegram.Bot.unpin_all_general_forum_topic_messages`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.5
Returns:
:obj:`bool`: On success, :obj:`True` is returned.

View file

@ -366,7 +366,7 @@ class ChatMemberRestricted(ChatMember):
All arguments were made positional and their order was changed.
The argument can_manage_topics was added.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
Removed deprecated argument and attribute ``can_send_media_messages``.
Args:

View file

@ -40,7 +40,7 @@ class ChatPermissions(TelegramObject):
.. versionchanged:: 20.0
:attr:`can_manage_topics` is considered as well when comparing objects of
this type in terms of equality.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
* :attr:`can_send_audios`, :attr:`can_send_documents`, :attr:`can_send_photos`,
:attr:`can_send_videos`, :attr:`can_send_video_notes` and :attr:`can_send_voice_notes`

View file

@ -30,7 +30,7 @@ class Animation(_BaseThumbedMedium):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`file_unique_id` is equal.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_note|
Args:

View file

@ -30,7 +30,7 @@ class Audio(_BaseThumbedMedium):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`file_unique_id` is equal.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_note|

View file

@ -31,7 +31,7 @@ class Document(_BaseThumbedMedium):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`file_unique_id` is equal.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_note|
Args:

View file

@ -123,7 +123,7 @@ class InputMediaAnimation(InputMedia):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_note|
Args:
@ -320,7 +320,7 @@ class InputMediaVideo(InputMedia):
easily generate thumbnails. However, this behaviour is undocumented and might be
changed by Telegram.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_note|
Args:
@ -449,7 +449,7 @@ class InputMediaAudio(InputMedia):
duration, performer and title from that video, unless otherwise specified with the
optional arguments.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_note|
Args:
@ -553,7 +553,7 @@ class InputMediaDocument(InputMedia):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_note|
Args:

View file

@ -42,7 +42,7 @@ class Sticker(_BaseThumbedMedium):
arguments had to be changed. Use keyword arguments to make sure that the arguments are
passed correctly.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_note|
Args:
@ -226,7 +226,7 @@ class StickerSet(TelegramObject):
.. versionchanged:: 20.0
The parameter ``contains_masks`` has been removed. Use :paramref:`sticker_type` instead.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_note|
Args:

View file

@ -30,7 +30,7 @@ class Video(_BaseThumbedMedium):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`file_unique_id` is equal.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_note|
Args:

View file

@ -31,7 +31,7 @@ class VideoNote(_BaseThumbedMedium):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`file_unique_id` is equal.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_note|
Args:

View file

@ -35,7 +35,7 @@ class InlineQueryResultArticle(InlineQueryResult):
Examples:
:any:`Inline Bot <examples.inlinebot>`
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
Removed the deprecated arguments and attributes ``thumb_*``.
Args:

View file

@ -35,7 +35,7 @@ class InlineQueryResultContact(InlineQueryResult):
Alternatively, you can use :attr:`input_message_content` to send a message with the specified
content instead of the contact.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_wildcard_note|
Args:

View file

@ -40,7 +40,7 @@ class InlineQueryResultDocument(InlineQueryResult):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_wildcard_note|
Args:

View file

@ -39,7 +39,7 @@ class InlineQueryResultGif(InlineQueryResult):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_wildcard_note|
Args:

View file

@ -35,7 +35,7 @@ class InlineQueryResultLocation(InlineQueryResult):
Alternatively, you can use :attr:`input_message_content` to send a message with the specified
content instead of the location.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_wildcard_note|
Args:

View file

@ -40,7 +40,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_wildcard_note|
Args:

View file

@ -39,7 +39,7 @@ class InlineQueryResultPhoto(InlineQueryResult):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_url_note|
Args:

View file

@ -39,7 +39,7 @@ class InlineQueryResultVenue(InlineQueryResult):
Foursquare details and Google Pace details are mutually exclusive. However, this
behaviour is undocumented and might be changed by Telegram.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_wildcard_note|
Args:

View file

@ -44,7 +44,7 @@ class InlineQueryResultVideo(InlineQueryResult):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|removed_thumb_url_note|
Args:

View file

@ -54,7 +54,7 @@ class KeyboardButton(TelegramObject):
.. versionchanged:: 20.0
:attr:`web_app` is considered as well when comparing objects of this type in terms of
equality.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
:attr:`request_user` and :attr:`request_chat` are considered as well when
comparing objects of this type in terms of equality.

View file

@ -202,7 +202,7 @@ class Message(TelegramObject):
about the sticker.
story (:class:`telegram.Story`, optional): Message is a forwarded story.
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.5
video (:class:`telegram.Video`, optional): Message is a video, information about the
video.
voice (:class:`telegram.Voice`, optional): Message is a voice message, information about
@ -439,7 +439,7 @@ class Message(TelegramObject):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
story (:class:`telegram.Story`): Optional. Message is a forwarded story.
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.5
video (:class:`telegram.Video`): Optional. Message is a video, information about the
video.
@ -3604,7 +3604,7 @@ class Message(TelegramObject):
* |custom_emoji_formatting_note|
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|custom_emoji_no_md1_support|
Returns:
@ -3651,7 +3651,7 @@ class Message(TelegramObject):
* |custom_emoji_formatting_note|
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|custom_emoji_no_md1_support|
Returns:
@ -3698,7 +3698,7 @@ class Message(TelegramObject):
* |custom_emoji_formatting_note|
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|custom_emoji_no_md1_support|
Returns:
@ -3747,7 +3747,7 @@ class Message(TelegramObject):
* |custom_emoji_formatting_note|
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
|custom_emoji_no_md1_support|
Returns:

View file

@ -87,9 +87,9 @@ class PollAnswer(TelegramObject):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`poll_id`, :attr:`user` and :attr:`option_ids` are equal.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
The order of :paramref:`option_ids` and :paramref:`user` is changed in
NEXT.VERSION as the latter one became optional. We currently provide
20.5 as the latter one became optional. We currently provide
backward compatibility for this but it will be removed in the future.
Please update your code to use the new order.
@ -104,12 +104,12 @@ class PollAnswer(TelegramObject):
if the voter isn't anonymous. If the voter is anonymous, this field will contain the
user :tg-const:`telegram.constants.ChatID.FAKE_CHANNEL` for backwards compatibility.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
:paramref:`user` became optional.
voter_chat (:class:`telegram.Chat`, optional): The chat that changed the answer to the
poll, if the voter is anonymous.
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.5
Attributes:
poll_id (:obj:`str`): Unique poll identifier.
@ -122,12 +122,12 @@ class PollAnswer(TelegramObject):
poll, if the voter isn't anonymous. If the voter is anonymous, this field will contain
the user :tg-const:`telegram.constants.ChatID.FAKE_CHANNEL` for backwards compatibility
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
:paramref:`user` became optional.
voter_chat (:class:`telegram.Chat`): Optional. The chat that changed the answer to the
poll, if the voter is anonymous.
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.5
"""

View file

@ -29,7 +29,7 @@ class Story(TelegramObject):
This object represents a message about a forwarded story in the chat. Currently holds no
information.
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.5
"""

View file

@ -51,7 +51,7 @@ class Version(NamedTuple):
__version_info__: Final[Version] = Version(
major=20, minor=4, micro=0, releaselevel="final", serial=0
major=20, minor=5, micro=0, releaselevel="final", serial=0
)
__version__: Final[str] = str(__version_info__)

View file

@ -662,7 +662,7 @@ class Application(Generic[BT, CCT, UD, CD, BD, JQ], AsyncContextManager["Applica
Note:
If the application is not running, this method does nothing.
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.5
"""
if self.running:
# This works because `__run` is using `loop.run_forever()`. If that changes, this

View file

@ -608,7 +608,7 @@ class ApplicationBuilder(Generic[BT, CCT, UD, CD, BD, JQ]):
http_version (:obj:`str`): Pass ``"2"`` or ``"2.0"`` if you'd like to use HTTP/2 for
making requests to Telegram. Defaults to ``"1.1"``, in which case HTTP/1.1 is used.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
Accept ``"2"`` as a valid value.
Returns:
@ -784,7 +784,7 @@ class ApplicationBuilder(Generic[BT, CCT, UD, CD, BD, JQ]):
HTTP/2 for making requests to Telegram. Defaults to ``"1.1"``, in which case
HTTP/1.1 is used.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
Accept ``"2"`` as a valid value.
Returns:

View file

@ -95,7 +95,7 @@ class CommandHandler(BaseHandler[Update, CCT]):
if :obj:`int`, the handler will only process if there are exactly that many args.
Defaults to :obj:`None`, which means the handler will process any or no args.
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.5
Raises:
:exc:`ValueError`: When the command is too long or has illegal chars.
@ -112,7 +112,7 @@ class CommandHandler(BaseHandler[Update, CCT]):
Optional argument, otherwise all implementations of :class:`CommandHandler` will break.
Defaults to :obj:`None`, which means the handler will process any args or no args.
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.5
"""
__slots__ = ("commands", "filters", "has_args")

View file

@ -147,7 +147,7 @@ class ExtBot(Bot, Generic[RLARGS]):
:attr:`bot.callback_data_cache.maxsize <telegram.ext.CallbackDataCache.maxsize>` to
access the size of the cache.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
Removed deprecated methods ``set_sticker_set_thumb`` and ``setStickerSetThumb``.
Args:

View file

@ -2154,7 +2154,7 @@ class _Story(MessageFilter):
STORY = _Story(name="filters.STORY")
"""Messages that contain :attr:`telegram.Message.story`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 20.5
"""

View file

@ -89,7 +89,7 @@ class HTTPXRequest(BaseRequest):
.. versionchanged:: 20.2
Reset the default version to 1.1.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 20.5
Accept ``"2"`` as a valid value.
"""