Bump version to v22.8 (#5262)

This commit is contained in:
Poolitzer
2026-06-12 10:02:13 +02:00
committed by GitHub
parent 0dd6afc177
commit 5d663af824
62 changed files with 212 additions and 202 deletions
@@ -0,0 +1,5 @@
other = "Bump Version to 22.8"
[[pull_requests]]
uid = "5262"
author_uids = ["Poolitzer"]
closes_threads = []
@@ -0,0 +1,5 @@
other = "Bump Version to 22.8"
[[pull_requests]]
uid = "5262"
author_uids = ["Poolitzer"]
closes_threads = []
+27 -27
View File
@@ -1247,7 +1247,7 @@ class Bot(TelegramObject, contextlib.AbstractAsyncContextManager["Bot"]):
0-:tg-const:`telegram.constants.MessageLimit.MAX_TEXT_LENGTH` characters after
entities parsing. Pass an empty text to show a "Thinking..." placeholder.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 22.8
Bot API 10.0 now makes this an optional parameter.
message_thread_id (:obj:`int`, optional): Unique identifier for the target
@@ -5031,7 +5031,7 @@ class Bot(TelegramObject, contextlib.AbstractAsyncContextManager["Bot"]):
that are administrators of the chat. By default, bots other than the current bot
are omitted.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Returns:
tuple[:class:`telegram.ChatMember`]: On success, returns a tuple of ``ChatMember``
@@ -5721,7 +5721,7 @@ class Bot(TelegramObject, contextlib.AbstractAsyncContextManager["Bot"]):
) -> SentGuestMessage:
"""Use this method to reply to a received guest message.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
guest_query_id (:obj:`str`): Unique identifier for the query to be answered.
@@ -7376,7 +7376,7 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified.
is_anonymous: bool | None = None,
type: str | None = None, # pylint: disable=redefined-builtin
allows_multiple_answers: bool | None = None,
# tags: deprecated in NEXT.VERSION, to be removed
# tags: deprecated in 22.8, to be removed
# replaced by `correct_option_ids`
correct_option_id: CorrectOptionID | None = None,
is_closed: bool | None = None,
@@ -7446,7 +7446,7 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified.
correct_option_id (:obj:`int`, optional): 0-based identifier of the correct answer
option, required for polls in quiz mode.
.. deprecated:: NEXT.VERSION
.. deprecated:: 22.8
Bot API 9.6 replaces this with :paramref:`correct_option_ids` instead.
explanation (:obj:`str`, optional): Text that is shown when a user chooses an incorrect
@@ -7517,44 +7517,44 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified.
change the chosen answer options, defaults to :obj:`False`
for quizzes and to :obj:`True` for regular polls
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
allow_adding_options (:obj:`bool`, optional): :obj:`True`, if answer options can be
added to the poll after creation; not supported for anonymous polls and quizzes
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
hide_results_until_closes (:obj:`bool`, optional): :obj:`True`, if poll results
must be shown only after the poll closes
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
correct_option_ids (Sequence[:class:`int`], optional): A list of monotonically
increasing 0-based identifiers of the correct answer options,
required for polls in quiz mode.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
description (:obj:`str`, optional): Description of the poll to be sent,
0-:tg-const:`telegram.Poll.MAX_DESCRIPTION_CHARACTERS` characters
after entities parsing.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
description_parse_mode (:obj:`str`, optional): Mode for parsing entities
in the poll description. See the constants
in :class:`telegram.constants.ParseMode`
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
description_entities (Sequence[:class:`telegram.MessageEntity`], optional): A
JSON-serialized list of special entities that appear in the poll description,
which can be specified instead of :paramref:`description_parse_mode`
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
shuffle_options (:obj:`bool`, optional): :obj:`True`, if the poll options must be
shown in random order
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
members_only (:obj:`bool`, optional): :obj:`True`, if voting is limited to users who
have been members of the chat where the poll is being sent for more than
:tg-const:`telegram.Poll.MIN_MEMBERSHIP_HOURS` hours; for channel chats only
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
country_codes (Sequence[:obj:`str`], optional): A list of
0-:tg-const:`telegram.constants.PollLimit.MAX_COUNTRY_CODES` two-letter
``ISO 3166-1 alpha-2`` country codes indicating the countries from which users can
@@ -7562,15 +7562,15 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified.
users with anonymous numbers to vote. If omitted or empty, then users from any
country can participate in the poll.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
explanation_media (:class:`telegram.InputPollMedia`, optional): Media added to the quiz
explanation
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
media (:class:`telegram.InputPollMedia`, optional): Media added to the poll
description.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Keyword Args:
allow_sending_without_reply (:obj:`bool`, optional): |allow_sending_without_reply|
@@ -7599,7 +7599,7 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified.
if correct_option_id is not None:
warn(
PTBDeprecationWarning(
version="NEXT.VERSION",
version="22.8",
message="Bot API 9.6 deprecated `correct_option_id` in favour of "
"`correct_option_ids`, please use that.",
),
@@ -10728,7 +10728,7 @@ CHAT_ACTIVITY_TIMEOUT` seconds.
"""
Use this method to get the access settings of a managed bot.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
user_id (:obj:`int`): User identifier of the managed bot whose access settings will be
@@ -10770,7 +10770,7 @@ CHAT_ACTIVITY_TIMEOUT` seconds.
"""
Use this method to change the access settings of a managed bot.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
user_id (:obj:`int`): User identifier of the managed bot whose access settings will be
@@ -10817,7 +10817,7 @@ CHAT_ACTIVITY_TIMEOUT` seconds.
Use this method to get the last messages from the personal chat (i.e., the chat currently
added to their profile) of a given user.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
user_id (:obj:`int`): Unique identifier of the target user.
@@ -11833,7 +11833,7 @@ CHAT_ACTIVITY_TIMEOUT` seconds.
"""
Use this method to get the token of a managed bot.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
user_id (:obj:`int`): User identifier of the managed bot whose token will be returned.
@@ -11868,7 +11868,7 @@ CHAT_ACTIVITY_TIMEOUT` seconds.
"""
Use this method to revoke the current token of a managed bot and generate a new one.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
user_id (:obj:`int`): User identifier of the managed bot whose token will be replaced.
@@ -11904,7 +11904,7 @@ CHAT_ACTIVITY_TIMEOUT` seconds.
"""
Stores a keyboard button that can be used by a user within a Mini App.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
user_id (:obj:`int`): Unique identifier of the target user that can use the button.
@@ -11970,7 +11970,7 @@ CHAT_ACTIVITY_TIMEOUT` seconds.
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
chat_id (:obj:`int` | :obj:`str`): |chat_id_channel|
@@ -12085,7 +12085,7 @@ CHAT_ACTIVITY_TIMEOUT` seconds.
The bot must have the :attr:`~telegram.ChatMemberAdministrator.can_delete_messages`
administrator right in the chat.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
chat_id (:obj:`int` | :obj:`str`): |chat_id_group|
@@ -12132,7 +12132,7 @@ CHAT_ACTIVITY_TIMEOUT` seconds.
:attr:`~telegram.ChatMemberAdministrator.can_delete_messages` administrator right in the
chat.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
chat_id (:obj:`int` | :obj:`str`): |chat_id_group|
+1 -1
View File
@@ -37,7 +37,7 @@ class BotAccessSettings(TelegramObject):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`is_access_restricted` and :attr:`added_users` are equal.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
is_access_restricted (:obj:`bool`): :obj:`True`, if only selected users can access the bot.
+4 -4
View File
@@ -1110,7 +1110,7 @@ class _ChatBase(TelegramObject):
For the documentation of the arguments, please see :meth:`telegram.Bot.send_message_draft`.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 22.8
Bot API 10.0 makes the ``text`` argument optional.
Returns:
@@ -1392,7 +1392,7 @@ class _ChatBase(TelegramObject):
For the documentation of the arguments, please see :meth:`telegram.Bot.send_live_photo`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Returns:
:class:`telegram.Message`: On success, instance representing the message posted.
@@ -4155,7 +4155,7 @@ class _ChatBase(TelegramObject):
For the documentation of the arguments, please see
:meth:`telegram.Bot.delete_message_reaction`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Returns:
:obj:`bool`: On success, :obj:`True` is returned.
@@ -4195,7 +4195,7 @@ class _ChatBase(TelegramObject):
For the documentation of the arguments, please see
:meth:`telegram.Bot.delete_all_message_reactions`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Returns:
:obj:`bool`: On success, :obj:`True` is returned.
+3 -3
View File
@@ -521,7 +521,7 @@ class ChatMemberRestricted(ChatMember):
can_react_to_messages (:obj:`bool`): :obj:`True`, if the user is allowed to react to
messages.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
tag (:obj:`str`, optional): Tag of the member.
.. versionadded:: 22.7
@@ -582,7 +582,7 @@ class ChatMemberRestricted(ChatMember):
can_react_to_messages (:obj:`bool`): :obj:`True`, if the user is allowed to react to
messages.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
tag (:obj:`str`): Optional. Tag of the member.
.. versionadded:: 22.7
@@ -632,7 +632,7 @@ class ChatMemberRestricted(ChatMember):
can_send_voice_notes: bool,
can_edit_tag: bool,
tag: str | None = None,
# tags: NEXT.VERSION
# tags: 22.8
# temporarily optional to make it not breaking
can_react_to_messages: bool | None = None,
*,
+3 -3
View File
@@ -50,7 +50,7 @@ class ChatPermissions(TelegramObject):
.. versionchanged:: 22.7
:attr:`can_edit_tag` is considered as well when comparing objects of
this type in terms of equality.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 22.8
:attr:`can_react_to_messages` is considered as well when comparing objects of
this type in terms of equality.
@@ -106,7 +106,7 @@ class ChatPermissions(TelegramObject):
can_react_to_messages (:obj:`bool`, optional): :obj:`True`, if the user is allowed to react
to messages. If omitted, defaults to the value of :attr:`can_send_messages`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Attributes:
can_send_messages (:obj:`bool`): Optional. :obj:`True`, if the user is allowed to send text
@@ -155,7 +155,7 @@ class ChatPermissions(TelegramObject):
can_react_to_messages (:obj:`bool`): Optional. :obj:`True`, if the user is allowed to react
to messages. If omitted, defaults to the value of :attr:`can_send_messages`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
+33 -33
View File
@@ -176,7 +176,7 @@ class InputPaidMedia(TelegramObject):
LIVE_PHOTO: Final[str] = constants.InputPaidMediaType.LIVE_PHOTO
""":const:`telegram.constants.InputPaidMediaType.LIVE_PHOTO`
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
__slots__ = ("media", "type")
@@ -342,7 +342,7 @@ class InputPaidMediaLivePhoto(InputPaidMedia):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
media (:obj:`str` | :term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` \
@@ -404,8 +404,8 @@ class InputMediaAnimation(InputMedia):
filename_depr (:obj:`str`, optional): Positional placeholder for keyword only parameter
:paramref:`filename`. For backward compatibility.
.. versionadded:: NEXT.VERSION
.. deprecated:: NEXT.VERSION
.. versionadded:: 22.8
.. deprecated:: 22.8
This parameter is deprecated, use :paramref:`filename` instead.
caption (:obj:`str`, optional): Caption of the animation to be sent,
0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters
@@ -441,7 +441,7 @@ class InputMediaAnimation(InputMedia):
:obj:`tempfile` module.
.. versionadded:: 13.1
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 22.8
This parameter is now keyword-only.
Attributes:
@@ -494,7 +494,7 @@ class InputMediaAnimation(InputMedia):
height: int | None = None,
duration: TimePeriod | None = None,
caption_entities: Sequence[MessageEntity] | None = None,
# tag: deprecated NEXT.VERSION
# tag: deprecated 22.8
filename_depr: str | None = None,
# -
has_spoiler: bool | None = None,
@@ -509,7 +509,7 @@ class InputMediaAnimation(InputMedia):
if filename_depr is not None:
warn(
PTBDeprecationWarning(
"NEXT.VERSION",
"22.8",
"Positional passing of `filename` or keyword usage of `filename_depr`"
" is deprecated. `filename` will become a keyword-only argument.",
),
@@ -565,8 +565,8 @@ class InputMediaPhoto(InputMedia):
filename_depr (:obj:`str`, optional): Positional placeholder for keyword only parameter
:paramref:`filename`. For backward compatibility.
.. versionadded:: NEXT.VERSION
.. deprecated:: NEXT.VERSION
.. versionadded:: 22.8
.. deprecated:: 22.8
This parameter is deprecated, use :paramref:`filename` instead.
caption (:obj:`str`, optional ): Caption of the photo to be sent,
0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after
@@ -590,7 +590,7 @@ class InputMediaPhoto(InputMedia):
:obj:`tempfile` module.
.. versionadded:: 13.1
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 22.8
This parameter is now keyword-only.
Attributes:
@@ -626,7 +626,7 @@ class InputMediaPhoto(InputMedia):
caption: str | None = None,
parse_mode: ODVInput[str] = DEFAULT_NONE,
caption_entities: Sequence[MessageEntity] | None = None,
# tag: deprecated NEXT.VERSION
# tag: deprecated 22.8
filename_depr: str | None = None,
# -
has_spoiler: bool | None = None,
@@ -640,7 +640,7 @@ class InputMediaPhoto(InputMedia):
if filename_depr is not None:
warn(
PTBDeprecationWarning(
"NEXT.VERSION",
"22.8",
"Positional passing of `filename` or keyword usage of `filename_depr`"
" is deprecated. `filename` will become a keyword-only argument.",
),
@@ -693,8 +693,8 @@ class InputMediaVideo(InputMedia):
filename_depr (:obj:`str`, optional): Positional placeholder for keyword only parameter
:paramref:`filename`. For backward compatibility.
.. versionadded:: NEXT.VERSION
.. deprecated:: NEXT.VERSION
.. versionadded:: 22.8
.. deprecated:: 22.8
This parameter is deprecated, use :paramref:`filename` instead.
caption (:obj:`str`, optional): Caption of the video to be sent,
0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after
@@ -738,7 +738,7 @@ class InputMediaVideo(InputMedia):
:obj:`tempfile` module.
.. versionadded:: 13.1
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 22.8
This parameter is now keyword-only.
Attributes:
@@ -803,7 +803,7 @@ class InputMediaVideo(InputMedia):
supports_streaming: bool | None = None,
parse_mode: ODVInput[str] = DEFAULT_NONE,
caption_entities: Sequence[MessageEntity] | None = None,
# tag: deprecated NEXT.VERSION
# tag: deprecated 22.8
filename_depr: str | None = None,
# -
has_spoiler: bool | None = None,
@@ -820,7 +820,7 @@ class InputMediaVideo(InputMedia):
if filename_depr is not None:
warn(
PTBDeprecationWarning(
"NEXT.VERSION",
"22.8",
"Positional passing of `filename` or keyword usage of `filename_depr`"
" is deprecated. `filename` will become a keyword-only argument.",
),
@@ -869,7 +869,7 @@ class InputMediaVideo(InputMedia):
class InputMediaLocation(_BaseInputMedia):
"""Represents a location to be sent.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
latitude (:obj:`float`): Latitude of the location.
@@ -905,7 +905,7 @@ class InputMediaLocation(_BaseInputMedia):
class InputMediaVenue(_BaseInputMedia):
"""Represents a venue to be sent.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
latitude (:obj:`float`): Latitude of the location.
@@ -976,7 +976,7 @@ class InputMediaSticker(_BaseInputMedia):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
media (:obj:`str` | :term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` | \
@@ -1039,8 +1039,8 @@ class InputMediaAudio(InputMedia):
filename_depr (:obj:`str`, optional): Positional placeholder for keyword only parameter
:paramref:`filename`. For backward compatibility.
.. versionadded:: NEXT.VERSION
.. deprecated:: NEXT.VERSION
.. versionadded:: 22.8
.. deprecated:: 22.8
This parameter is deprecated, use :paramref:`filename` instead.
caption (:obj:`str`, optional): Caption of the audio to be sent,
0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after
@@ -1070,7 +1070,7 @@ class InputMediaAudio(InputMedia):
:obj:`tempfile` module.
.. versionadded:: 13.1
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 22.8
This parameter is now keyword-only.
Attributes:
@@ -1111,7 +1111,7 @@ class InputMediaAudio(InputMedia):
performer: str | None = None,
title: str | None = None,
caption_entities: Sequence[MessageEntity] | None = None,
# tag: deprecated NEXT.VERSION
# tag: deprecated 22.8
filename_depr: str | None = None,
# -
thumbnail: "FileInput | None" = None,
@@ -1124,7 +1124,7 @@ class InputMediaAudio(InputMedia):
if filename_depr is not None:
warn(
PTBDeprecationWarning(
"NEXT.VERSION",
"22.8",
"Positional passing of `filename` or keyword usage of `filename_depr`"
" is deprecated. `filename` will become a keyword-only argument.",
),
@@ -1181,8 +1181,8 @@ class InputMediaDocument(InputMedia):
filename_depr (:obj:`str`, optional): Positional placeholder for keyword only parameter
:paramref:`filename`. For backward compatibility.
.. versionadded:: NEXT.VERSION
.. deprecated:: NEXT.VERSION
.. versionadded:: 22.8
.. deprecated:: 22.8
This parameter is deprecated, use :paramref:`filename` instead.
caption (:obj:`str`, optional): Caption of the document to be sent,
0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after
@@ -1207,7 +1207,7 @@ class InputMediaDocument(InputMedia):
:obj:`tempfile` module.
.. versionadded:: 13.1
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 22.8
This parameter is now keyword-only.
Attributes:
@@ -1240,7 +1240,7 @@ class InputMediaDocument(InputMedia):
parse_mode: ODVInput[str] = DEFAULT_NONE,
disable_content_type_detection: bool | None = None,
caption_entities: Sequence[MessageEntity] | None = None,
# tag: deprecated NEXT.VERSION
# tag: deprecated 22.8
filename_depr: str | None = None,
# -
thumbnail: "FileInput | None" = None,
@@ -1253,7 +1253,7 @@ class InputMediaDocument(InputMedia):
if filename_depr is not None:
warn(
PTBDeprecationWarning(
"NEXT.VERSION",
"22.8",
"Positional passing of `filename` or keyword usage of `filename_depr`"
" is deprecated. `filename` will become a keyword-only argument.",
),
@@ -1285,7 +1285,7 @@ class InputMediaLivePhoto(InputMedia):
.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
media (:obj:`str` | :term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` \
@@ -1364,7 +1364,7 @@ InputPollMedia: TypeAlias = (
)
"""Type alias for InputPollMedia objects.
versionadded:: NEXT.VERSION
versionadded:: 22.8
"""
InputPollOptionMedia: TypeAlias = (
@@ -1378,5 +1378,5 @@ InputPollOptionMedia: TypeAlias = (
)
"""Type alias for InputPollOptionMedia objects.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
+1 -1
View File
@@ -39,7 +39,7 @@ class LivePhoto(_BaseMedium):
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.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
file_id (:obj:`str`): Identifier for the video file which can be used to download or reuse
+2 -2
View File
@@ -130,7 +130,7 @@ class KeyboardButton(TelegramObject):
in the `@BotFather <https://telegram.me/BotFather>` Mini App. Available in private
chats only.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Attributes:
@@ -185,7 +185,7 @@ class KeyboardButton(TelegramObject):
in the `@BotFather <https://telegram.me/BotFather>` Mini App. Available in private
chats only.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
__slots__ = (
+1 -1
View File
@@ -280,7 +280,7 @@ class KeyboardButtonRequestManagedBot(TelegramObject):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`request_id` is equal.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
request_id (:obj:`int`): Signed 32-bit identifier of the request. Must be unique
+2 -2
View File
@@ -38,7 +38,7 @@ class ManagedBotCreated(TelegramObject):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`bot` is equal.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
bot (:class:`telegram.User`): Information about the bot. The bot's token can be fetched
@@ -79,7 +79,7 @@ class ManagedBotUpdated(TelegramObject):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`user` and :attr:`bot` are equal.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
user (:class:`telegram.User`): User that created the bot.
+20 -20
View File
@@ -699,40 +699,40 @@ class Message(MaybeInaccessibleMessage):
poll_option_added (:class:`telegram.PollOptionAdded`, optional): Service message:
answer option was added to a poll.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
poll_option_deleted (:class:`telegram.PollOptionDeleted`, optional): Service message:
answer option was deleted from a poll.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
reply_to_poll_option_id (:obj:`str`, optional): Persistent
identifier of the specific poll option that is being replied to.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
managed_bot_created (:class:`telegram.ManagedBotCreated`, optional): Service message: user
created a bot that will be managed by the current bot.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
guest_bot_caller_user (:class:`telegram.User`, optional): For a message sent by a guest
bot, this is the user whose original message triggered the bot's response.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
guest_bot_caller_chat (:class:`telegram.Chat`, optional): For a message sent by a guest
bot, this is the chat whose original message triggered the bot's response.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
guest_query_id (:obj:`str`, optional): The unique identifier for the guest query. Use this
identifier with the method :meth:`telegram.Bot.answer_guest_query` to send a response
message. If non-empty, the message belongs to the chat where the guest bot was
summoned, which may not coincide with other existing bot chats sharing the same
identifier.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
live_photo (:class:`telegram.LivePhoto`, optional): Message is a live photo, information
about the live photo. For backward compatibility, when this field is set, the photo
field will also be set.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Attributes:
message_id (:obj:`int`): Unique message identifier inside this chat. In specific instances
@@ -1152,39 +1152,39 @@ class Message(MaybeInaccessibleMessage):
poll_option_added (:class:`telegram.PollOptionAdded`): Optional. Service message:
answer option was added to a poll.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
poll_option_deleted (:class:`telegram.PollOptionDeleted`): Optional. Service message:
answer option was deleted from a poll.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
reply_to_poll_option_id (:obj:`str`): Optional. Persistent
identifier of the specific poll option that is being replied to.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
managed_bot_created (:class:`telegram.ManagedBotCreated`): Optional. Service message: user
created a bot that will be managed by the current bot.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
guest_bot_caller_user (:class:`telegram.User`): Optional. For a message sent by a guest
bot, this is the user whose original message triggered the bot's response.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
guest_bot_caller_chat (:class:`telegram.Chat`): Optional. For a message sent by a guest
bot, this is the chat whose original message triggered the bot's response.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
guest_query_id (:obj:`str`): Optional. The unique identifier for the guest query. Use this
identifier with the method :meth:`telegram.Bot.answer_guest_query` to send a response
message. If non-empty, the message belongs to the chat where the guest bot was
summoned, which may not coincide with other existing bot chats sharing the same
identifier.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
live_photo (:class:`telegram.LivePhoto`): Optional. Message is a live photo, information
about the live photo. For backward compatibility, when this field is set, the photo
field will also be set.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
.. |custom_emoji_no_md1_support| replace:: Since custom emoji entities are not supported by
:attr:`~telegram.constants.ParseMode.MARKDOWN`, this method now raises a
@@ -2279,7 +2279,7 @@ class Message(MaybeInaccessibleMessage):
.. versionadded:: 22.6
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 22.8
Bot API 10.0 makes the ``text`` argument optional.
Returns:
@@ -2756,7 +2756,7 @@ class Message(MaybeInaccessibleMessage):
For the documentation of the arguments, please see :meth:`telegram.Bot.send_live_photo`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Keyword Args:
do_quote (:obj:`bool` | :obj:`dict`, optional): |do_quote|
@@ -5400,7 +5400,7 @@ class Message(MaybeInaccessibleMessage):
For the documentation of the arguments, please see
:meth:`telegram.Bot.delete_message_reaction`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Returns:
:obj:`bool` On success, :obj:`True` is returned.
@@ -5436,7 +5436,7 @@ class Message(MaybeInaccessibleMessage):
For the documentation of the arguments, please see :meth:`telegram.Bot.answer_guest_query`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Returns:
:class:`telegram.SentGuestMessage`: On success, a
+1 -1
View File
@@ -262,7 +262,7 @@ class PaidMediaLivePhoto(PaidMedia):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`live_photo` are equal.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
type (:obj:`str`): Type of the paid media, always :tg-const:`telegram.PaidMedia.LIVE_PHOTO`
+50 -50
View File
@@ -65,7 +65,7 @@ class PollMedia(TelegramObject):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if all of their attributes are equal.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
animation (:class:`telegram.Animation`, optional): Media is an animation, information about
@@ -195,7 +195,7 @@ class InputPollOption(TelegramObject):
This list is empty if the text does not contain entities.
media (:class:`telegram.InputPollOptionMedia`, optional): Media added to the poll option.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Attributes:
text (:obj:`str`): Option text,
@@ -210,7 +210,7 @@ class InputPollOption(TelegramObject):
This list is empty if the text does not contain entities.
media (:class:`telegram.InputPollOptionMedia`): Optional. Media added to the poll option.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
__slots__ = ("media", "text", "text_entities", "text_parse_mode")
@@ -234,18 +234,18 @@ class InputPollOption(TelegramObject):
self._freeze()
# tags: deprecated NEXT.VERSION
# tags: deprecated 22.8
@classmethod
def de_json(cls, data: JSONDict, bot: "Bot | None" = None) -> "InputPollOption":
"""See :meth:`telegram.TelegramObject.de_json`. The :paramref:`media` field will
not be included for deserialization.
.. deprecated:: NEXT.VERSION
.. deprecated:: 22.8
This class is input only and will be removed in the next version.
"""
warn(
PTBDeprecationWarning(
"NEXT.VERSION",
"22.8",
"`InputPollOption.de_json` is deprecated. This class is input only and will be "
"removed in the next version. The `media` field will not be included for "
"deserialization.",
@@ -267,7 +267,7 @@ class PollOption(TelegramObject):
considered equal, if their :attr:`text`, :attr:`voter_count` and :attr:`persistent_id`
are equal.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 22.8
Added attribute :attr:`persistent_id` to equality checks.
@@ -275,7 +275,7 @@ class PollOption(TelegramObject):
persistent_id (:obj:`str`): Unique identifier of the option, persistent on option addition
and deletion.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
text (:obj:`str`): Option text,
:tg-const:`telegram.PollOption.MIN_LENGTH`-:tg-const:`telegram.PollOption.MAX_LENGTH`
characters.
@@ -287,25 +287,25 @@ class PollOption(TelegramObject):
.. versionadded:: 21.2
media (:class:`telegram.PollMedia`, optional): Media added to the poll option.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
added_by_user (:class:`telegram.User`, optional): User who added the option;
omitted if the option wasn't added by a user after poll creation.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
added_by_chat (:class:`telegram.Chat`, optional): Chat that added the option;
omitted if the option wasn't added by a chat after poll creation.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
addition_date (:obj:`datetime.datetime`, optional): Point in time
when the option was added; omitted if the option existed in the original poll.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Attributes:
persistent_id (:obj:`str`): Unique identifier of the option, persistent on option addition
and deletion.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
text (:obj:`str`): Option text,
:tg-const:`telegram.PollOption.MIN_LENGTH`-:tg-const:`telegram.PollOption.MAX_LENGTH`
characters.
@@ -318,19 +318,19 @@ class PollOption(TelegramObject):
.. versionadded:: 21.2
media (:class:`telegram.PollMedia`): Optional. Media added to the poll option.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
added_by_user (:class:`telegram.User`): Optional. User who added the option;
omitted if the option wasn't added by a user after poll creation.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
added_by_chat (:class:`telegram.Chat`): Optional. Chat that added the option;
omitted if the option wasn't added by a chat after poll creation.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
addition_date (:obj:`datetime.datetime`): Optional. Point in time
when the option was added; omitted if the option existed in the original poll.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
__slots__ = (
@@ -353,7 +353,7 @@ class PollOption(TelegramObject):
added_by_chat: Chat | None = None,
addition_date: dtm.datetime | None = None,
media: PollMedia | None = None,
# tags: required in NEXT.VERSION, bot api 9.6
# tags: required in 22.8, bot api 9.6
# temporarily optional to avoid breaking changes
persistent_id: str | None = None,
*,
@@ -474,7 +474,7 @@ class PollAnswer(TelegramObject):
option_persistent_ids (Sequence[:obj:`str`]): Persistent identifiers of the
chosen answer options. May be empty if the vote was retracted.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
user (:class:`telegram.User`, optional): The user that changed the answer to the 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.
@@ -496,7 +496,7 @@ class PollAnswer(TelegramObject):
option_persistent_ids (tuple[:obj:`str`]): Persistent identifiers of the
chosen answer options. May be empty if the vote was retracted.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
user (:class:`telegram.User`): Optional. The user, who changed the answer to the
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
@@ -517,7 +517,7 @@ class PollAnswer(TelegramObject):
option_ids: Sequence[int],
user: User | None = None,
voter_chat: Chat | None = None,
# tags: required in NEXT.VERSION, bot api 9.6
# tags: required in 22.8, bot api 9.6
# temporarily optional to avoid breaking changes
option_persistent_ids: Sequence[str] | None = None,
*,
@@ -560,7 +560,7 @@ class PollOptionAdded(TelegramObject):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`option_persistent_id`, and :attr:`option_text` are equal.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
option_persistent_id (:obj:`str`): Unique identifier of the added option.
@@ -675,7 +675,7 @@ class PollOptionDeleted(TelegramObject):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`option_persistent_id`, :attr:`option_text` are equal.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
option_persistent_id (:obj:`str`): Unique identifier of the deleted option.
@@ -809,12 +809,12 @@ class Poll(TelegramObject):
members of the chat where the poll was originally sent for more than
:tg-const:`telegram.Poll.MIN_MEMBERSHIP_HOURS` hours.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
correct_option_id (:obj:`int`, optional): A zero based identifier of the correct answer
option. Available only for closed polls in the quiz mode, which were sent
(not forwarded), by the bot or to a private chat with the bot.
.. deprecated:: NEXT.VERSION
.. deprecated:: 22.8
Use :paramref:`correct_option_ids` instead.
explanation (:obj:`str`, optional): Text that is shown when a user chooses an incorrect
answer or taps on the lamp icon in a quiz-style poll,
@@ -831,7 +831,7 @@ class Poll(TelegramObject):
explanation_media (:class:`telegram.PollMedia`, optional): Media added to the quiz
explanation.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
open_period (:obj:`int` | :class:`datetime.timedelta`, optional): Amount of time in seconds
the poll will be active after creation.
@@ -850,30 +850,30 @@ class Poll(TelegramObject):
allows_revoting (:obj:`bool`, optional): :obj:`True`, if the poll allows to
change the chosenanswer options.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
correct_option_ids (Sequence[:class:`int`], optional): Array of 0-based identifiers of
the correct answer options. Available only for polls in quiz mode which are closed or
were sent (not forwarded) by the bot or to the private chat with the bot.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
country_codes (Sequence[:obj:`str`], optional): A list of two-letter ``ISO 3166-1 alpha-2``
country codes indicating the countries from which users can vote in the poll. The
country code ``"FT"`` is used for users with anonymous numbers. If omitted, then users
from any country can participate in the poll.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
description (:obj:`str`, optional): Description of the poll;
for polls inside the :class:`~telegram.Message` object only.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
description_entities (Sequence[:class:`telegram.MessageEntity`], optional): Special
entities like usernames, URLs, bot commands, etc. that appear in the description
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
media (:class:`telegram.PollMedia`, optional): Media added to the poll description;
for polls inside the :class:`~telegram.Message` object only.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Attributes:
id (:obj:`str`): Unique poll identifier.
@@ -892,7 +892,7 @@ class Poll(TelegramObject):
members of the chat where the poll was originally sent for more than
:tg-const:`telegram.Poll.MIN_MEMBERSHIP_HOURS` hours.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
explanation (:obj:`str`): Optional. Text that is shown when a user chooses an incorrect
answer or taps on the lamp icon in a quiz-style poll,
0-:tg-const:`telegram.Poll.MAX_EXPLANATION_LENGTH` characters.
@@ -908,7 +908,7 @@ class Poll(TelegramObject):
explanation_media (:class:`telegram.PollMedia`): Optional. Media added to the quiz
explanation.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
open_period (:obj:`int` | :class:`datetime.timedelta`): Optional. Amount of time in seconds
the poll will be active after creation.
@@ -928,30 +928,30 @@ class Poll(TelegramObject):
allows_revoting (:obj:`bool`): :obj:`True`, if the poll
allows to change the chosenanswer options
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
correct_option_ids (tuple[:class:`int`]): Array of 0-based identifiers of the
correct answer options. Available only for polls in quiz mode which are closed or were
sent (not forwarded) by the bot or to the private chat with the bot.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
country_codes (tuple[:obj:`str`]): Optional. A list of two-letter ``ISO 3166-1 alpha-2``
country codes indicating the countries from which users can vote in the poll. The
country code ``"FT"`` is used for users with anonymous numbers. If omitted, then users
from any country can participate in the poll.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
description (:obj:`str`): Optional. Description of the poll;
for polls inside the Message object only
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
description_entities (tuple[:class:`telegram.MessageEntity`]): Special
entities like usernames, URLs, bot commands, etc. that appear in the description
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
media (:class:`telegram.PollMedia`): Optional. Media added to the poll description;
for polls inside the Message object only.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
@@ -989,7 +989,7 @@ class Poll(TelegramObject):
is_anonymous: bool,
type: str, # pylint: disable=redefined-builtin
allows_multiple_answers: bool,
# tags: deprecated NEXT.VERSION
# tags: deprecated 22.8
# Removed in bot api 9.6:
correct_option_id: int | None = None,
# ---
@@ -998,7 +998,7 @@ class Poll(TelegramObject):
open_period: TimePeriod | None = None,
close_date: dtm.datetime | None = None,
question_entities: Sequence[MessageEntity] | None = None,
# tags: required in NEXT.VERSION
# tags: required in 22.8
# temporarily optional to avoid breaking changes
allows_revoting: bool | None = None,
members_only: bool | None = None,
@@ -1030,11 +1030,11 @@ class Poll(TelegramObject):
self.allows_revoting: bool = allows_revoting
self.members_only: bool = members_only
# tag: deprecated NEXT.VERSION
# tag: deprecated 22.8
if correct_option_id is not None:
warn(
PTBDeprecationWarning(
"NEXT.VERSION",
"22.8",
"The parameter `correct_option_id` is deprecated. "
"Use `correct_option_ids` instead.",
),
@@ -1196,7 +1196,7 @@ class Poll(TelegramObject):
"""Returns the text in :attr:`description` from a given :class:`telegram.MessageEntity` of
:attr:`description_entities`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Note:
This method is present because Telegram calculates the offset and length in
@@ -1227,7 +1227,7 @@ class Poll(TelegramObject):
It contains entities from this polls description 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:: 22.8
Note:
This method should always be used instead of the :attr:`description_entities`
@@ -1255,12 +1255,12 @@ class Poll(TelegramObject):
option. Available only for closed polls in the quiz mode, which were sent
(not forwarded), by the bot or to a private chat with the bot.
.. deprecated:: NEXT.VERSION
.. deprecated:: 22.8
Use :attr:`correct_option_ids` instead.
"""
warn(
PTBDeprecationWarning(
"NEXT.VERSION",
"22.8",
"The attribute `correct_option_id` is deprecated. "
"Use `correct_option_ids` instead.",
),
@@ -1325,10 +1325,10 @@ class Poll(TelegramObject):
MAX_DESCRIPTION_CHARACTERS: Final[int] = constants.PollLimit.MAX_DESCRIPTION_CHARACTERS
""":const:`telegram.constants.PollLimit.MAX_DESCRIPTION_CHARACTERS`
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
MIN_MEMBERSHIP_HOURS: Final[int] = constants.PollLimit.MIN_MEMBERSHIP_HOURS
""":const:`telegram.constants.PollLimit.MIN_MEMBERSHIP_HOURS`
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
+1 -1
View File
@@ -31,7 +31,7 @@ class PreparedKeyboardButton(TelegramObject):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`id` is equal.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
id (:obj:`str`): Unique identifier of the keyboard button.
+4 -4
View File
@@ -118,7 +118,7 @@ class ExternalReplyInfo(TelegramObject):
live_photo (:class:`telegram.LivePhoto`, optional): Message is a live photo, information
about the live photo.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Attributes:
origin (:class:`telegram.MessageOrigin`): Origin of the message replied to by the given
@@ -174,7 +174,7 @@ class ExternalReplyInfo(TelegramObject):
live_photo (:class:`telegram.LivePhoto`): Optional. Message is a live photo, information
about the live photo.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
@@ -427,7 +427,7 @@ class ReplyParameters(TelegramObject):
poll_option_id (:obj:`str`, optional): Persistent
identifier of the specific poll option to be replied to.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Attributes:
message_id (:obj:`int`): Identifier of the message that will be replied to in the current
@@ -458,7 +458,7 @@ class ReplyParameters(TelegramObject):
poll_option_id (:obj:`str`): Optional. Persistent
identifier of the specific poll option to be replied to.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
__slots__ = (
+1 -1
View File
@@ -28,7 +28,7 @@ class SentGuestMessage(TelegramObject):
Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`inline_message_id` are equal.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
inline_message_id (:obj:`str`): Identifier of the sent inline message.
+10 -10
View File
@@ -167,12 +167,12 @@ class Update(TelegramObject):
managed_bot (:class:`telegram.ManagedBotUpdated`, optional): A new bot was created to be
managed by the bot, or token or owner of a managed bot was changed.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
guest_message (:class:`telegram.Message`, optional): New guest message. The bot can use
the field :attr:`telegram.Message.guest_query_id` and the method
:meth:`telegram.Bot.answer_guest_query` to send a message in response.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Attributes:
@@ -289,12 +289,12 @@ class Update(TelegramObject):
managed_bot (:class:`telegram.ManagedBotUpdated`): Optional. A new bot was created to be
managed by the bot, or token or owner of a managed bot was changed.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
guest_message (:class:`telegram.Message`): Optional. New guest message. The bot can use
the field :attr:`telegram.Message.guest_query_id` and the method
:meth:`telegram.Bot.answerGuestQuery` to send a message in response.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
__slots__ = (
@@ -428,12 +428,12 @@ class Update(TelegramObject):
MANAGED_BOT: Final[str] = constants.UpdateType.MANAGED_BOT
""":const:`telegram.constants.UpdateType.MANAGED_BOT`
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
GUEST_MESSAGE: Final[str] = constants.UpdateType.GUEST_MESSAGE
""":const:`telegram.constants.UpdateType.GUEST_MESSAGE`
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
ALL_TYPES: Final[list[str]] = list(constants.UpdateType)
@@ -533,7 +533,7 @@ class Update(TelegramObject):
.. versionchanged:: 21.6
This property now also considers :attr:`purchased_paid_media`.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 22.8
This property now also considers :attr:`managed_bot`, :attr:`guest_message`,
:attr:`channel_post`, and :attr:`edited_channel_post`.
@@ -626,7 +626,7 @@ class Update(TelegramObject):
is present.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 22.8
This property now also considers :attr:`guest_message`.
Example:
@@ -683,7 +683,7 @@ class Update(TelegramObject):
This property now also considers :attr:`business_message`,
:attr:`edited_business_message`, and :attr:`deleted_business_messages`.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 22.8
This property now also considers :attr:`guest_message`.
Example:
@@ -747,7 +747,7 @@ class Update(TelegramObject):
This property now also considers :attr:`business_message`, and
:attr:`edited_business_message`.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 22.8
This property now also considers :attr:`guest_message`.
Tip:
+12 -12
View File
@@ -132,12 +132,12 @@ class User(TelegramObject):
can_manage_bots (:obj:`bool`, optional): :obj:`True`, if other bots can be created to be
controlled by the bot. Returned only in :meth:`telegram.Bot.get_me`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
supports_guest_queries (:obj:`bool`, optional): :obj:`True`, if the bot supports guest
queries from chats it is not a member of. Returned only in
:meth:`telegram.Bot.get_me`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Attributes:
id (:obj:`int`): Unique identifier for this user or bot.
@@ -181,12 +181,12 @@ class User(TelegramObject):
can_manage_bots (:obj:`bool`): Optional. :obj:`True`, if other bots can be created to be
controlled by the bot. Returned only in :meth:`telegram.Bot.get_me`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
supports_guest_queries (:obj:`bool`): Optional. :obj:`True`, if the bot supports guest
queries from chats it is not a member of. Returned only in
:meth:`telegram.Bot.get_me`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
.. |user_chat_id_note| replace:: This shortcuts build on the assumption that :attr:`User.id`
coincides with the :attr:`Chat.id` of the private chat with the user. This has been the
@@ -567,7 +567,7 @@ class User(TelegramObject):
.. versionadded:: 22.6
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 22.8
Bot API 10.0 makes the ``text`` argument optional.
Returns:
@@ -756,7 +756,7 @@ class User(TelegramObject):
For the documentation of the arguments, please see :meth:`telegram.Bot.send_live_photo`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Note:
|user_chat_id_note|
@@ -2859,7 +2859,7 @@ class User(TelegramObject):
For the documentation of the arguments, please see
:meth:`telegram.Bot.replace_managed_bot_token`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Returns:
:obj:`str`: On success, :obj:`str` is returned.
@@ -2893,7 +2893,7 @@ class User(TelegramObject):
For the documentation of the arguments, please see
:meth:`telegram.Bot.get_managed_bot_access_settings`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Returns:
:class:`telegram.BotAccessSettings`: On success, returns the access settings of the bot
@@ -2931,7 +2931,7 @@ class User(TelegramObject):
For the documentation of the arguments, please see
:meth:`telegram.Bot.set_managed_bot_access_settings`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Returns:
:obj:`bool`: On success, :obj:`True` is returned.
@@ -2972,7 +2972,7 @@ class User(TelegramObject):
For the documentation of the arguments, please see
:meth:`telegram.Bot.delete_message_reaction`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Returns:
:obj:`bool`: On success, :obj:`True` is returned.
@@ -3010,7 +3010,7 @@ class User(TelegramObject):
For the documentation of the arguments, please see
:meth:`telegram.Bot.get_user_personal_chat_messages`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Returns:
tuple[:class:`telegram.Message`]: On success, a tuple of messages from the personal
@@ -3050,7 +3050,7 @@ class User(TelegramObject):
For the documentation of the arguments, please see
:meth:`telegram.Bot.delete_all_message_reactions`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Returns:
:obj:`bool`: On success, :obj:`True` is returned.
+1 -1
View File
@@ -95,7 +95,7 @@ CorrectOptionID: TypeAlias = Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] # pylint: di
CorrectOptionIds: TypeAlias = Sequence[Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]]
"""
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
MarkdownVersion: TypeAlias = Literal[1, 2]
+1 -1
View File
@@ -51,6 +51,6 @@ class Version(NamedTuple):
__version_info__: Final[Version] = Version(
major=22, minor=7, micro=0, releaselevel="final", serial=0
major=22, minor=8, micro=0, releaselevel="final", serial=0
)
__version__: Final[str] = str(__version_info__)
+18 -18
View File
@@ -1527,7 +1527,7 @@ class BaseInputMediaType(StringEnum):
:class:`telegram.InputPollMedia` and :class:`telegram.InputPollOptionMedia`. The enum
members of this enumeration are instances of :class:`str` and can be treated as such.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
__slots__ = ()
@@ -1556,7 +1556,7 @@ class InputMediaType(StringEnum):
"""This enum contains the available types of :class:`telegram.InputMedia`. The enum
members of this enumeration are instances of :class:`str` and can be treated as such.
.. deprecated:: NEXT.VERSION
.. deprecated:: 22.8
Use :class:`telegram.constants.BaseInputMediaType` instead.
.. versionadded:: 20.0
@@ -1577,7 +1577,7 @@ class InputMediaType(StringEnum):
LIVE_PHOTO = "live_photo"
""":obj:`str`: Type of :class:`telegram.InputMediaLivePhoto`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
@@ -1597,7 +1597,7 @@ class InputPaidMediaType(StringEnum):
LIVE_PHOTO = "live_photo"
""":obj:`str`: Type of :class:`telegram.InputPaidMediaLivePhoto`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
@@ -2014,7 +2014,7 @@ class MessageAttachmentType(StringEnum):
LIVE_PHOTO = "live_photo"
""":obj:`str`: Messages with :attr:`telegram.Message.live_photo`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
LOCATION = "location"
""":obj:`str`: Messages with :attr:`telegram.Message.location`."""
@@ -2401,7 +2401,7 @@ class MessageType(StringEnum):
LIVE_PHOTO = "live_photo"
""":obj:`str`: Messages with :attr:`telegram.Message.live_photo`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
LOCATION = "location"
""":obj:`str`: Messages with :attr:`telegram.Message.location`."""
@@ -2430,12 +2430,12 @@ class MessageType(StringEnum):
POLL_OPTION_ADDED = "poll_option_added"
""":obj:`str`: Messages with :attr:`telegram.Message.poll_option_added`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
POLL_OPTION_DELETED = "poll_option_deleted"
""":obj:`str`: Messages with :attr:`telegram.Message.poll_option_deleted`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
SUGGESTED_POST_APPROVAL_FAILED = "suggested_post_approval_failed"
""":obj:`str`: Messages with :attr:`telegram.Message.suggested_post_approval_failed`.
@@ -2627,7 +2627,7 @@ class PaidMediaType(StringEnum):
LIVE_PHOTO = "live_photo"
""":obj:`str`: The type of :class:`telegram.PaidMediaLivePhoto`
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
@@ -2636,7 +2636,7 @@ class PersonalChatMessagesLimit(IntEnum):
:paramref:`telegram.Bot.get_user_personal_chat_messages.limit`.
The enum members of this enumeration are instances of :class:`int` and can be treated as such.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
__slots__ = ()
@@ -3512,7 +3512,7 @@ class PollLimit(IntEnum):
to the :paramref:`~telegram.Bot.send_poll.options` parameter of
:meth:`telegram.Bot.send_poll`.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 22.8
Bot API 10.0 decreased this value from ``2`` to ``1``.
"""
MAX_OPTION_NUMBER = 12
@@ -3545,27 +3545,27 @@ class PollLimit(IntEnum):
Also used in the :paramref:`~telegram.Bot.send_poll.close_date` parameter of
:meth:`telegram.Bot.send_poll`.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 22.8
Changed from ``600`` to ``2628000`` since Bot API 9.6.
"""
MAX_DESCRIPTION_CHARACTERS = 1024
""":obj:`int`: Maximum value allowed for the
:paramref:`~telegram.Bot.send_poll.description` parameter of :meth:`telegram.Bot.send_poll`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
MIN_MEMBERSHIP_HOURS = 24
""":obj:`int`: Minimum number of hours a user must have been a member of the chat
before they can vote in a members-only poll.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
MAX_COUNTRY_CODES = 12
""":obj:`int`: Maximum number of two-letter ``ISO 3166-1 alpha-2`` country codes passed in a
:obj:`list` to the :paramref:`~telegram.Bot.send_poll.country_codes` parameter of
:meth:`telegram.Bot.send_poll`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
@@ -3719,12 +3719,12 @@ class UpdateType(StringEnum):
MANAGED_BOT = "managed_bot"
""":obj:`str`: Updates with :attr:`telegram.Update.managed_bot`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
GUEST_MESSAGE = "guest_message"
""":obj:`str`: Updates with :attr:`telegram.Update.guest_message`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
@@ -4149,7 +4149,7 @@ class ManagedBotAccessLimit(IntEnum):
"""This enum contains limitations for :meth:`~telegram.Bot.set_managed_bot_access_settings`.
The enum members of this enumeration are instances of :class:`int` and can be treated as such.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
__slots__ = ()
@@ -34,7 +34,7 @@ class ManagedBotUpdatedHandler(BaseHandler[Update, CCT, RT]):
"""Handler class to handle
:attr:`updated Telegram Managed Bots <telegram.Update.managed_bot>`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
Args:
callback (:term:`coroutine function`): The callback function for this handler. Will be
+5 -5
View File
@@ -274,7 +274,7 @@ class BaseFilter:
:attr:`~telegram.Update.business_message`
or :attr:`~telegram.Update.edited_business_message`.
.. versionchanged:: NEXT.VERSION
.. versionchanged:: 22.8
This filter now also returns :obj:`True` if the update contains
:attr:`~telegram.Update.guest_message`.
@@ -1668,7 +1668,7 @@ class _LivePhoto(MessageFilter):
LIVE_PHOTO = _LivePhoto(name="filters.LIVE_PHOTO")
"""Messages that contain :attr:`telegram.Message.live_photo`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
@@ -2374,7 +2374,7 @@ class StatusUpdate:
POLL_OPTION_ADDED = _PollOptionAdded(name="filters.StatusUpdate.POLL_OPTION_ADDED")
"""Messages that contain :attr:`telegram.Message.poll_option_added`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
class _PollOptionDeleted(MessageFilter):
@@ -2385,7 +2385,7 @@ class StatusUpdate:
POLL_OPTION_DELETED = _PollOptionDeleted(name="filters.StatusUpdate.POLL_OPTION_DELETED")
"""Messages that contain :attr:`telegram.Message.poll_option_deleted`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""
class _ProximityAlertTriggered(MessageFilter):
@@ -2924,7 +2924,7 @@ class UpdateType:
GUEST_MESSAGE = _GuestMessage(name="filters.UpdateType.GUEST_MESSAGE")
"""Updates with :attr:`telegram.Update.guest_message`.
.. versionadded:: NEXT.VERSION
.. versionadded:: 22.8
"""