Skip to content

API 7.6 Documentation Updates #4348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions telegram/_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7645,7 +7645,8 @@ async def copy_message(
pool_timeout: ODVInput[float] = DEFAULT_NONE,
api_kwargs: Optional[JSONDict] = None,
) -> MessageId:
"""Use this method to copy messages of any kind. Service messages and invoice messages
"""Use this method to copy messages of any kind. Service messages, paid media messages,
giveaway messages, giveaway winners messages, and invoice messages
can't be copied. The method is analogous to the method :meth:`forward_message`, but the
copied message doesn't have a link to the original message.

Expand Down Expand Up @@ -7771,8 +7772,9 @@ async def copy_messages(
) -> Tuple["MessageId", ...]:
"""
Use this method to copy messages of any kind. If some of the specified messages can't be
found or copied, they are skipped. Service messages, giveaway messages, giveaway winners
messages, and invoice messages can't be copied. A quiz poll can be copied only if the value
found or copied, they are skipped. Service messages, paid media messages, giveaway
messages, giveaway winners messages, and invoice messages can't be copied. A quiz pollcan
be copied only if the value
of the field correct_option_id is known to the bot. The method is analogous to the method
:meth:`forward_messages`, but the copied messages don't have a link to the original
message. Album grouping is kept for copied messages.
Expand Down
4 changes: 2 additions & 2 deletions telegram/_files/_basethumbedmedium.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class _BaseThumbedMedium(_BaseMedium):
is supposed to be the same over time and for different bots.
Can't be used to download or reuse the file.
file_size (:obj:`int`, optional): File size.
thumbnail (:class:`telegram.PhotoSize`, optional): Thumbnail as defined by sender.
thumbnail (:class:`telegram.PhotoSize`, optional): Thumbnail as defined by the sender.

.. versionadded:: 20.2

Expand All @@ -54,7 +54,7 @@ class _BaseThumbedMedium(_BaseMedium):
is supposed to be the same over time and for different bots.
Can't be used to download or reuse the file.
file_size (:obj:`int`): Optional. File size.
thumbnail (:class:`telegram.PhotoSize`): Optional. Thumbnail as defined by sender.
thumbnail (:class:`telegram.PhotoSize`): Optional. Thumbnail as defined by the sender.

.. versionadded:: 20.2

Expand Down
20 changes: 10 additions & 10 deletions telegram/_files/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ class Animation(_BaseThumbedMedium):
file_unique_id (:obj:`str`): Unique identifier for this file, which
is supposed to be the same over time and for different bots.
Can't be used to download or reuse the file.
width (:obj:`int`): Video width as defined by sender.
height (:obj:`int`): Video height as defined by sender.
duration (:obj:`int`): Duration of the video in seconds as defined by sender.
file_name (:obj:`str`, optional): Original animation filename as defined by sender.
mime_type (:obj:`str`, optional): MIME type of the file as defined by sender.
width (:obj:`int`): Video width as defined by the sender.
height (:obj:`int`): Video height as defined by the sender.
duration (:obj:`int`): Duration of the video in seconds as defined by the sender.
file_name (:obj:`str`, optional): Original animation filename as defined by the sender.
mime_type (:obj:`str`, optional): MIME type of the file as defined by the sender.
file_size (:obj:`int`, optional): File size in bytes.
thumbnail (:class:`telegram.PhotoSize`, optional): Animation thumbnail as defined by
sender.
Expand All @@ -56,11 +56,11 @@ class Animation(_BaseThumbedMedium):
file_unique_id (:obj:`str`): Unique identifier for this file, which
is supposed to be the same over time and for different bots.
Can't be used to download or reuse the file.
width (:obj:`int`): Video width as defined by sender.
height (:obj:`int`): Video height as defined by sender.
duration (:obj:`int`): Duration of the video in seconds as defined by sender.
file_name (:obj:`str`): Optional. Original animation filename as defined by sender.
mime_type (:obj:`str`): Optional. MIME type of the file as defined by sender.
width (:obj:`int`): Video width as defined by the sender.
height (:obj:`int`): Video height as defined by the sender.
duration (:obj:`int`): Duration of the video in seconds as defined by the sender.
file_name (:obj:`str`): Optional. Original animation filename as defined by the sender.
mime_type (:obj:`str`): Optional. MIME type of the file as defined by the sender.
file_size (:obj:`int`): Optional. File size in bytes.
thumbnail (:class:`telegram.PhotoSize`): Optional. Animation thumbnail as defined by
sender.
Expand Down
24 changes: 12 additions & 12 deletions telegram/_files/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ class Audio(_BaseThumbedMedium):
or reuse the file.
file_unique_id (:obj:`str`): Unique identifier for this file, which is supposed to be
the same over time and for different bots. Can't be used to download or reuse the file.
duration (:obj:`int`): Duration of the audio in seconds as defined by sender.
performer (:obj:`str`, optional): Performer of the audio as defined by sender or by audio
tags.
title (:obj:`str`, optional): Title of the audio as defined by sender or by audio tags.
file_name (:obj:`str`, optional): Original filename as defined by sender.
mime_type (:obj:`str`, optional): MIME type of the file as defined by sender.
duration (:obj:`int`): Duration of the audio in seconds as defined by the sender.
performer (:obj:`str`, optional): Performer of the audio as defined by the sender or by
audio tags.
title (:obj:`str`, optional): Title of the audio as defined by the sender or by audio tags.
file_name (:obj:`str`, optional): Original filename as defined by the sender.
mime_type (:obj:`str`, optional): MIME type of the file as defined by the sender.
file_size (:obj:`int`, optional): File size in bytes.
thumbnail (:class:`telegram.PhotoSize`, optional): Thumbnail of the album cover to
which the music file belongs.
Expand All @@ -56,12 +56,12 @@ class Audio(_BaseThumbedMedium):
or reuse the file.
file_unique_id (:obj:`str`): Unique identifier for this file, which is supposed to be
the same over time and for different bots. Can't be used to download or reuse the file.
duration (:obj:`int`): Duration of the audio in seconds as defined by sender.
performer (:obj:`str`): Optional. Performer of the audio as defined by sender or by audio
tags.
title (:obj:`str`): Optional. Title of the audio as defined by sender or by audio tags.
file_name (:obj:`str`): Optional. Original filename as defined by sender.
mime_type (:obj:`str`): Optional. MIME type of the file as defined by sender.
duration (:obj:`int`): Duration of the audio in seconds as defined by the sender.
performer (:obj:`str`): Optional. Performer of the audio as defined by the sender or by
audio tags.
title (:obj:`str`): Optional. Title of the audio as defined by the sender or by audio tags.
file_name (:obj:`str`): Optional. Original filename as defined by the sender.
mime_type (:obj:`str`): Optional. MIME type of the file as defined by the sender.
file_size (:obj:`int`): Optional. File size in bytes.
thumbnail (:class:`telegram.PhotoSize`): Optional. Thumbnail of the album cover to
which the music file belongs.
Expand Down
14 changes: 8 additions & 6 deletions telegram/_files/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ class Document(_BaseThumbedMedium):
or reuse the file.
file_unique_id (:obj:`str`): Unique identifier for this file, which is supposed to be
the same over time and for different bots. Can't be used to download or reuse the file.
file_name (:obj:`str`, optional): Original filename as defined by sender.
mime_type (:obj:`str`, optional): MIME type of the file as defined by sender.
file_name (:obj:`str`, optional): Original filename as defined by the sender.
mime_type (:obj:`str`, optional): MIME type of the file as defined by the sender.
file_size (:obj:`int`, optional): File size in bytes.
thumbnail (:class:`telegram.PhotoSize`, optional): Document thumbnail as defined by sender.
thumbnail (:class:`telegram.PhotoSize`, optional): Document thumbnail as defined by the
sender.

.. versionadded:: 20.2

Expand All @@ -51,10 +52,11 @@ class Document(_BaseThumbedMedium):
or reuse the file.
file_unique_id (:obj:`str`): Unique identifier for this file, which is supposed to be
the same over time and for different bots. Can't be used to download or reuse the file.
file_name (:obj:`str`): Optional. Original filename as defined by sender.
mime_type (:obj:`str`): Optional. MIME type of the file as defined by sender.
file_name (:obj:`str`): Optional. Original filename as defined by the sender.
mime_type (:obj:`str`): Optional. MIME type of the file as defined by the sender.
file_size (:obj:`int`): Optional. File size in bytes.
thumbnail (:class:`telegram.PhotoSize`): Optional. Document thumbnail as defined by sender.
thumbnail (:class:`telegram.PhotoSize`): Optional. Document thumbnail as defined by the
sender.

.. versionadded:: 20.2

Expand Down
14 changes: 7 additions & 7 deletions telegram/_files/inputmedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,10 +510,10 @@ class InputMediaAudio(InputMedia):
.. versionchanged:: 20.0
|sequenceclassargs|

duration (:obj:`int`, optional): Duration of the audio in seconds as defined by sender.
performer (:obj:`str`, optional): Performer of the audio as defined by sender or by audio
tags.
title (:obj:`str`, optional): Title of the audio as defined by sender or by audio tags.
duration (:obj:`int`, optional): Duration of the audio in seconds as defined by the sender.
performer (:obj:`str`, optional): Performer of the audio as defined by the sender or by
audio tags.
title (:obj:`str`, optional): Title of the audio as defined by the sender or by audio tags.
thumbnail (:term:`file object` | :obj:`bytes` | :class:`pathlib.Path` | :obj:`str`, \
optional): |thumbdocstringnopath|

Expand All @@ -533,9 +533,9 @@ class InputMediaAudio(InputMedia):
* |tupleclassattrs|
* |alwaystuple|
duration (:obj:`int`): Optional. Duration of the audio in seconds.
performer (:obj:`str`): Optional. Performer of the audio as defined by sender or by audio
tags.
title (:obj:`str`): Optional. Title of the audio as defined by sender or by audio tags.
performer (:obj:`str`): Optional. Performer of the audio as defined by the sender or by
audio tags.
title (:obj:`str`): Optional. Title of the audio as defined by the sender or by audio tags.
thumbnail (:class:`telegram.InputFile`): Optional. |thumbdocstringbase|

.. versionadded:: 20.2
Expand Down
8 changes: 4 additions & 4 deletions telegram/_files/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class Location(TelegramObject):
considered equal, if their :attr:`longitude` and :attr:`latitude` are equal.

Args:
longitude (:obj:`float`): Longitude as defined by sender.
latitude (:obj:`float`): Latitude as defined by sender.
longitude (:obj:`float`): Longitude as defined by the sender.
latitude (:obj:`float`): Latitude as defined by the sender.
horizontal_accuracy (:obj:`float`, optional): The radius of uncertainty for the location,
measured in meters; 0-:tg-const:`telegram.Location.HORIZONTAL_ACCURACY`.
live_period (:obj:`int`, optional): Time relative to the message sending date, during which
Expand All @@ -45,8 +45,8 @@ class Location(TelegramObject):
approaching another chat member, in meters. For sent live locations only.

Attributes:
longitude (:obj:`float`): Longitude as defined by sender.
latitude (:obj:`float`): Latitude as defined by sender.
longitude (:obj:`float`): Longitude as defined by the sender.
latitude (:obj:`float`): Latitude as defined by the sender.
horizontal_accuracy (:obj:`float`): Optional. The radius of uncertainty for the location,
measured in meters; 0-:tg-const:`telegram.Location.HORIZONTAL_ACCURACY`.
live_period (:obj:`int`): Optional. Time relative to the message sending date, during which
Expand Down
20 changes: 10 additions & 10 deletions telegram/_files/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ class Video(_BaseThumbedMedium):
file_unique_id (:obj:`str`): Unique identifier for this file, which
is supposed to be the same over time and for different bots.
Can't be used to download or reuse the file.
width (:obj:`int`): Video width as defined by sender.
height (:obj:`int`): Video height as defined by sender.
duration (:obj:`int`): Duration of the video in seconds as defined by sender.
file_name (:obj:`str`, optional): Original filename as defined by sender.
mime_type (:obj:`str`, optional): MIME type of a file as defined by sender.
width (:obj:`int`): Video width as defined by the sender.
height (:obj:`int`): Video height as defined by the sender.
duration (:obj:`int`): Duration of the video in seconds as defined by the sender.
file_name (:obj:`str`, optional): Original filename as defined by the sender.
mime_type (:obj:`str`, optional): MIME type of a file as defined by the sender.
file_size (:obj:`int`, optional): File size in bytes.
thumbnail (:class:`telegram.PhotoSize`, optional): Video thumbnail.

Expand All @@ -55,11 +55,11 @@ class Video(_BaseThumbedMedium):
file_unique_id (:obj:`str`): Unique identifier for this file, which
is supposed to be the same over time and for different bots.
Can't be used to download or reuse the file.
width (:obj:`int`): Video width as defined by sender.
height (:obj:`int`): Video height as defined by sender.
duration (:obj:`int`): Duration of the video in seconds as defined by sender.
file_name (:obj:`str`): Optional. Original filename as defined by sender.
mime_type (:obj:`str`): Optional. MIME type of a file as defined by sender.
width (:obj:`int`): Video width as defined by the sender.
height (:obj:`int`): Video height as defined by the sender.
duration (:obj:`int`): Duration of the video in seconds as defined by the sender.
file_name (:obj:`str`): Optional. Original filename as defined by the sender.
mime_type (:obj:`str`): Optional. MIME type of a file as defined by the sender.
file_size (:obj:`int`): Optional. File size in bytes.
thumbnail (:class:`telegram.PhotoSize`): Optional. Video thumbnail.

Expand Down
4 changes: 2 additions & 2 deletions telegram/_files/videonote.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class VideoNote(_BaseThumbedMedium):
Can't be used to download or reuse the file.
length (:obj:`int`): Video width and height (diameter of the video message) as defined
by sender.
duration (:obj:`int`): Duration of the video in seconds as defined by sender.
duration (:obj:`int`): Duration of the video in seconds as defined by the sender.
file_size (:obj:`int`, optional): File size in bytes.
thumbnail (:class:`telegram.PhotoSize`, optional): Video thumbnail.

Expand All @@ -56,7 +56,7 @@ class VideoNote(_BaseThumbedMedium):
Can't be used to download or reuse the file.
length (:obj:`int`): Video width and height (diameter of the video message) as defined
by sender.
duration (:obj:`int`): Duration of the video in seconds as defined by sender.
duration (:obj:`int`): Duration of the video in seconds as defined by the sender.
file_size (:obj:`int`): Optional. File size in bytes.
thumbnail (:class:`telegram.PhotoSize`): Optional. Video thumbnail.

Expand Down
8 changes: 4 additions & 4 deletions telegram/_files/voice.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class Voice(_BaseMedium):
file_unique_id (:obj:`str`): Unique identifier for this file, which
is supposed to be the same over time and for different bots.
Can't be used to download or reuse the file.
duration (:obj:`int`): Duration of the audio in seconds as defined by sender.
mime_type (:obj:`str`, optional): MIME type of the file as defined by sender.
duration (:obj:`int`): Duration of the audio in seconds as defined by the sender.
mime_type (:obj:`str`, optional): MIME type of the file as defined by the sender.
file_size (:obj:`int`, optional): File size in bytes.

Attributes:
Expand All @@ -45,8 +45,8 @@ class Voice(_BaseMedium):
file_unique_id (:obj:`str`): Unique identifier for this file, which
is supposed to be the same over time and for different bots.
Can't be used to download or reuse the file.
duration (:obj:`int`): Duration of the audio in seconds as defined by sender.
mime_type (:obj:`str`): Optional. MIME type of the file as defined by sender.
duration (:obj:`int`): Duration of the audio in seconds as defined by the sender.
mime_type (:obj:`str`): Optional. MIME type of the file as defined by the sender.
file_size (:obj:`int`): Optional. File size in bytes.

"""
Expand Down
9 changes: 7 additions & 2 deletions telegram/_menubutton.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,20 @@ class MenuButtonWebApp(MenuButton):
web_app (:class:`telegram.WebAppInfo`): Description of the Web App that will be launched
when the user presses the button. The Web App will be able to send an arbitrary
message on behalf of the user using the method :meth:`~telegram.Bot.answerWebAppQuery`
of :class:`~telegram.Bot`.
of :class:`~telegram.Bot`. Alternatively, a ``t.me`` link to a Web App of the bot can
be specified in the object instead of the Web App's URL, in which case the Web App
will be opened as if the user pressed the link.


Attributes:
type (:obj:`str`): :tg-const:`telegram.constants.MenuButtonType.WEB_APP`.
text (:obj:`str`): Text of the button.
web_app (:class:`telegram.WebAppInfo`): Description of the Web App that will be launched
when the user presses the button. The Web App will be able to send an arbitrary
message on behalf of the user using the method :meth:`~telegram.Bot.answerWebAppQuery`
of :class:`~telegram.Bot`.
of :class:`~telegram.Bot`. Alternatively, a ``t.me`` link to a Web App of the bot can
be specified in the object instead of the Web App's URL, in which case the Web App
will be opened as if the user pressed the link.
"""

__slots__ = ("text", "web_app")
Expand Down
6 changes: 4 additions & 2 deletions telegram/_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ class Message(MaybeInaccessibleMessage):
.. versionchanged:: 20.0
|sequenceclassargs|

caption (:obj:`str`, optional): Caption for the animation, audio, document, photo, video
caption (:obj:`str`, optional): Caption for the animation, audio, document, paid media,
photo, video
or voice, 0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters.
contact (:class:`telegram.Contact`, optional): Message is a shared contact, information
about the contact.
Expand Down Expand Up @@ -697,7 +698,8 @@ class Message(MaybeInaccessibleMessage):

.. versionchanged:: 20.0
|tupleclassattrs|
caption (:obj:`str`): Optional. Caption for the animation, audio, document, photo, video
caption (:obj:`str`): Optional. Caption for the animation, audio, document, paid media,
photo, video
or voice, 0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters.
contact (:class:`telegram.Contact`): Optional. Message is a shared contact, information
about the contact.
Expand Down
Loading
Loading