Bot API 6.6 (#1139)

* Added basic support of Bot API 6.6

* Update descriptions

* Added StickerFormat enum

* Bump version

* Refresh from docs

* Fixed CommandStart

* Fixed files uploading

* Cover new functionality

* Added changelog

* Update texts
This commit is contained in:
Alex Root Junior 2023-03-11 02:17:47 +02:00 committed by GitHub
parent 5adaf7a567
commit 6570d0bab1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
218 changed files with 7687 additions and 1741 deletions

View file

@ -14,6 +14,8 @@ from .bot_command_scope_chat import BotCommandScopeChat
from .bot_command_scope_chat_administrators import BotCommandScopeChatAdministrators
from .bot_command_scope_chat_member import BotCommandScopeChatMember
from .bot_command_scope_default import BotCommandScopeDefault
from .bot_description import BotDescription
from .bot_short_description import BotShortDescription
from .callback_game import CallbackGame
from .callback_query import CallbackQuery
from .chat import Chat
@ -86,6 +88,7 @@ from .input_media_document import InputMediaDocument
from .input_media_photo import InputMediaPhoto
from .input_media_video import InputMediaVideo
from .input_message_content import InputMessageContent
from .input_sticker import InputSticker
from .input_text_message_content import InputTextMessageContent
from .input_venue_message_content import InputVenueMessageContent
from .invoice import Invoice
@ -165,6 +168,8 @@ __all__ = (
"BotCommandScopeChatAdministrators",
"BotCommandScopeChatMember",
"BotCommandScopeDefault",
"BotDescription",
"BotShortDescription",
"BufferedInputFile",
"CallbackGame",
"CallbackQuery",
@ -240,6 +245,7 @@ __all__ = (
"InputMediaPhoto",
"InputMediaVideo",
"InputMessageContent",
"InputSticker",
"InputTextMessageContent",
"InputVenueMessageContent",
"Invoice",

View file

@ -25,7 +25,7 @@ class Animation(TelegramObject):
"""Video height as defined by sender"""
duration: int
"""Duration of the video in seconds as defined by sender"""
thumb: Optional[PhotoSize] = None
thumbnail: Optional[PhotoSize] = None
"""*Optional*. Animation thumbnail as defined by sender"""
file_name: Optional[str] = None
"""*Optional*. Original animation filename as defined by sender"""

View file

@ -31,5 +31,5 @@ class Audio(TelegramObject):
"""*Optional*. MIME type of the file as defined by sender"""
file_size: Optional[int] = None
"""*Optional*. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."""
thumb: Optional[PhotoSize] = None
thumbnail: Optional[PhotoSize] = None
"""*Optional*. Thumbnail of the album cover to which the music file belongs"""

View file

@ -0,0 +1,12 @@
from aiogram.types import TelegramObject
class BotDescription(TelegramObject):
"""
This object represents the bot's description.
Source: https://core.telegram.org/bots/api#botdescription
"""
description: str
"""The bot's description"""

View file

@ -0,0 +1,12 @@
from aiogram.types import TelegramObject
class BotShortDescription(TelegramObject):
"""
This object represents the bot's short description.
Source: https://core.telegram.org/bots/api#botshortdescription
"""
short_description: str
"""The bot's short description"""

View file

@ -19,7 +19,7 @@ class Document(TelegramObject):
"""Identifier for this file, which can be used to download or reuse the file"""
file_unique_id: 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."""
thumb: Optional[PhotoSize] = None
thumbnail: Optional[PhotoSize] = None
"""*Optional*. Document thumbnail as defined by sender"""
file_name: Optional[str] = None
"""*Optional*. Original filename as defined by sender"""

View file

@ -35,9 +35,9 @@ class InlineQueryResultArticle(InlineQueryResult):
"""*Optional*. Pass :code:`True` if you don't want the URL to be shown in the message"""
description: Optional[str] = None
"""*Optional*. Short description of the result"""
thumb_url: Optional[str] = None
thumbnail_url: Optional[str] = None
"""*Optional*. Url of the thumbnail for the result"""
thumb_width: Optional[int] = None
thumbnail_width: Optional[int] = None
"""*Optional*. Thumbnail width"""
thumb_height: Optional[int] = None
thumbnail_height: Optional[int] = None
"""*Optional*. Thumbnail height"""

View file

@ -36,9 +36,9 @@ class InlineQueryResultContact(InlineQueryResult):
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
input_message_content: Optional[InputMessageContent] = None
"""*Optional*. Content of the message to be sent instead of the contact"""
thumb_url: Optional[str] = None
thumbnail_url: Optional[str] = None
"""*Optional*. Url of the thumbnail for the result"""
thumb_width: Optional[int] = None
thumbnail_width: Optional[int] = None
"""*Optional*. Thumbnail width"""
thumb_height: Optional[int] = None
thumbnail_height: Optional[int] = None
"""*Optional*. Thumbnail height"""

View file

@ -44,9 +44,9 @@ class InlineQueryResultDocument(InlineQueryResult):
"""*Optional*. Inline keyboard attached to the message"""
input_message_content: Optional[InputMessageContent] = None
"""*Optional*. Content of the message to be sent instead of the file"""
thumb_url: Optional[str] = None
thumbnail_url: Optional[str] = None
"""*Optional*. URL of the thumbnail (JPEG only) for the file"""
thumb_width: Optional[int] = None
thumbnail_width: Optional[int] = None
"""*Optional*. Thumbnail width"""
thumb_height: Optional[int] = None
thumbnail_height: Optional[int] = None
"""*Optional*. Thumbnail height"""

View file

@ -27,7 +27,7 @@ class InlineQueryResultGif(InlineQueryResult):
"""Unique identifier for this result, 1-64 bytes"""
gif_url: str
"""A valid URL for the GIF file. File size must not exceed 1MB"""
thumb_url: str
thumbnail_url: str
"""URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"""
gif_width: Optional[int] = None
"""*Optional*. Width of the GIF"""
@ -35,7 +35,7 @@ class InlineQueryResultGif(InlineQueryResult):
"""*Optional*. Height of the GIF"""
gif_duration: Optional[int] = None
"""*Optional*. Duration of the GIF in seconds"""
thumb_mime_type: Optional[str] = None
thumbnail_mime_type: Optional[str] = None
"""*Optional*. MIME type of the thumbnail, must be one of 'image/jpeg', 'image/gif', or 'video/mp4'. Defaults to 'image/jpeg'"""
title: Optional[str] = None
"""*Optional*. Title for the result"""

View file

@ -42,9 +42,9 @@ class InlineQueryResultLocation(InlineQueryResult):
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
input_message_content: Optional[InputMessageContent] = None
"""*Optional*. Content of the message to be sent instead of the location"""
thumb_url: Optional[str] = None
thumbnail_url: Optional[str] = None
"""*Optional*. Url of the thumbnail for the result"""
thumb_width: Optional[int] = None
thumbnail_width: Optional[int] = None
"""*Optional*. Thumbnail width"""
thumb_height: Optional[int] = None
thumbnail_height: Optional[int] = None
"""*Optional*. Thumbnail height"""

View file

@ -27,7 +27,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult):
"""Unique identifier for this result, 1-64 bytes"""
mpeg4_url: str
"""A valid URL for the MPEG4 file. File size must not exceed 1MB"""
thumb_url: str
thumbnail_url: str
"""URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"""
mpeg4_width: Optional[int] = None
"""*Optional*. Video width"""
@ -35,7 +35,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult):
"""*Optional*. Video height"""
mpeg4_duration: Optional[int] = None
"""*Optional*. Video duration in seconds"""
thumb_mime_type: Optional[str] = None
thumbnail_mime_type: Optional[str] = None
"""*Optional*. MIME type of the thumbnail, must be one of 'image/jpeg', 'image/gif', or 'video/mp4'. Defaults to 'image/jpeg'"""
title: Optional[str] = None
"""*Optional*. Title for the result"""

View file

@ -27,7 +27,7 @@ class InlineQueryResultPhoto(InlineQueryResult):
"""Unique identifier for this result, 1-64 bytes"""
photo_url: str
"""A valid URL of the photo. Photo must be in **JPEG** format. Photo size must not exceed 5MB"""
thumb_url: str
thumbnail_url: str
"""URL of the thumbnail for the photo"""
photo_width: Optional[int] = None
"""*Optional*. Width of the photo"""

View file

@ -44,9 +44,9 @@ class InlineQueryResultVenue(InlineQueryResult):
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
input_message_content: Optional[InputMessageContent] = None
"""*Optional*. Content of the message to be sent instead of the venue"""
thumb_url: Optional[str] = None
thumbnail_url: Optional[str] = None
"""*Optional*. Url of the thumbnail for the result"""
thumb_width: Optional[int] = None
thumbnail_width: Optional[int] = None
"""*Optional*. Thumbnail width"""
thumb_height: Optional[int] = None
thumbnail_height: Optional[int] = None
"""*Optional*. Thumbnail height"""

View file

@ -31,7 +31,7 @@ class InlineQueryResultVideo(InlineQueryResult):
"""A valid URL for the embedded video player or video file"""
mime_type: str
"""MIME type of the content of the video URL, 'text/html' or 'video/mp4'"""
thumb_url: str
thumbnail_url: str
"""URL of the thumbnail (JPEG only) for the video"""
title: str
"""Title for the result"""

View file

@ -24,7 +24,7 @@ class InputMediaAnimation(InputMedia):
"""Type of the result, must be *animation*"""
media: Union[str, InputFile]
"""File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. :ref:`More information on Sending Files » <sending-files>`"""
thumb: Optional[Union[InputFile, str]] = None
thumbnail: Optional[Union[InputFile, str]] = None
"""*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
caption: Optional[str] = None
"""*Optional*. Caption of the animation to be sent, 0-1024 characters after entities parsing"""

View file

@ -24,7 +24,7 @@ class InputMediaAudio(InputMedia):
"""Type of the result, must be *audio*"""
media: Union[str, InputFile]
"""File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. :ref:`More information on Sending Files » <sending-files>`"""
thumb: Optional[Union[InputFile, str]] = None
thumbnail: Optional[Union[InputFile, str]] = None
"""*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
caption: Optional[str] = None
"""*Optional*. Caption of the audio to be sent, 0-1024 characters after entities parsing"""

View file

@ -24,7 +24,7 @@ class InputMediaDocument(InputMedia):
"""Type of the result, must be *document*"""
media: Union[str, InputFile]
"""File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. :ref:`More information on Sending Files » <sending-files>`"""
thumb: Optional[Union[InputFile, str]] = None
thumbnail: Optional[Union[InputFile, str]] = None
"""*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
caption: Optional[str] = None
"""*Optional*. Caption of the document to be sent, 0-1024 characters after entities parsing"""

View file

@ -24,7 +24,7 @@ class InputMediaVideo(InputMedia):
"""Type of the result, must be *video*"""
media: Union[str, InputFile]
"""File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. :ref:`More information on Sending Files » <sending-files>`"""
thumb: Optional[Union[InputFile, str]] = None
thumbnail: Optional[Union[InputFile, str]] = None
"""*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
caption: Optional[str] = None
"""*Optional*. Caption of the video to be sent, 0-1024 characters after entities parsing"""

View file

@ -0,0 +1,26 @@
from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional, Union
from .base import TelegramObject
if TYPE_CHECKING:
from .input_file import InputFile
from .mask_position import MaskPosition
class InputSticker(TelegramObject):
"""
This object describes a sticker to be added to a sticker set.
Source: https://core.telegram.org/bots/api#inputsticker
"""
sticker: Union[InputFile, str]
"""The added sticker. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. Animated and video stickers can't be uploaded via HTTP URL. :ref:`More information on Sending Files » <sending-files>`"""
emoji_list: List[str]
"""List of 1-20 emoji associated with the sticker"""
mask_position: Optional[MaskPosition] = None
"""*Optional*. Position where the mask should be placed on faces. For 'mask' stickers only."""
keywords: Optional[List[str]] = None
"""*Optional*. List of 0-20 search keywords for the sticker with total length of up to 64 characters. For 'regular' and 'custom_emoji' stickers only."""

View file

@ -348,7 +348,7 @@ class Message(TelegramObject):
duration: Optional[int] = None,
width: Optional[int] = None,
height: Optional[int] = None,
thumb: Optional[Union[InputFile, str]] = None,
thumbnail: Optional[Union[InputFile, str]] = None,
caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET,
caption_entities: Optional[List[MessageEntity]] = None,
@ -377,7 +377,7 @@ class Message(TelegramObject):
:param duration: Duration of sent animation in seconds
:param width: Animation width
:param height: Animation height
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param caption: Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing
:param parse_mode: Mode for parsing entities in the animation caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
@ -401,7 +401,7 @@ class Message(TelegramObject):
duration=duration,
width=width,
height=height,
thumb=thumb,
thumbnail=thumbnail,
caption=caption,
parse_mode=parse_mode,
caption_entities=caption_entities,
@ -419,7 +419,7 @@ class Message(TelegramObject):
duration: Optional[int] = None,
width: Optional[int] = None,
height: Optional[int] = None,
thumb: Optional[Union[InputFile, str]] = None,
thumbnail: Optional[Union[InputFile, str]] = None,
caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET,
caption_entities: Optional[List[MessageEntity]] = None,
@ -448,7 +448,7 @@ class Message(TelegramObject):
:param duration: Duration of sent animation in seconds
:param width: Animation width
:param height: Animation height
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param caption: Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing
:param parse_mode: Mode for parsing entities in the animation caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
@ -472,7 +472,7 @@ class Message(TelegramObject):
duration=duration,
width=width,
height=height,
thumb=thumb,
thumbnail=thumbnail,
caption=caption,
parse_mode=parse_mode,
caption_entities=caption_entities,
@ -494,7 +494,7 @@ class Message(TelegramObject):
duration: Optional[int] = None,
performer: Optional[str] = None,
title: Optional[str] = None,
thumb: Optional[Union[InputFile, str]] = None,
thumbnail: Optional[Union[InputFile, str]] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
allow_sending_without_reply: Optional[bool] = None,
@ -523,7 +523,7 @@ class Message(TelegramObject):
:param duration: Duration of the audio in seconds
:param performer: Performer
:param title: Track name
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving
:param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
@ -546,7 +546,7 @@ class Message(TelegramObject):
duration=duration,
performer=performer,
title=title,
thumb=thumb,
thumbnail=thumbnail,
disable_notification=disable_notification,
protect_content=protect_content,
allow_sending_without_reply=allow_sending_without_reply,
@ -563,7 +563,7 @@ class Message(TelegramObject):
duration: Optional[int] = None,
performer: Optional[str] = None,
title: Optional[str] = None,
thumb: Optional[Union[InputFile, str]] = None,
thumbnail: Optional[Union[InputFile, str]] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
reply_to_message_id: Optional[int] = None,
@ -592,7 +592,7 @@ class Message(TelegramObject):
:param duration: Duration of the audio in seconds
:param performer: Performer
:param title: Track name
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving
:param reply_to_message_id: If the message is a reply, ID of the original message
@ -615,7 +615,7 @@ class Message(TelegramObject):
duration=duration,
performer=performer,
title=title,
thumb=thumb,
thumbnail=thumbnail,
disable_notification=disable_notification,
protect_content=protect_content,
reply_to_message_id=reply_to_message_id,
@ -740,7 +740,7 @@ class Message(TelegramObject):
def reply_document(
self,
document: Union[InputFile, str],
thumb: Optional[Union[InputFile, str]] = None,
thumbnail: Optional[Union[InputFile, str]] = None,
caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET,
caption_entities: Optional[List[MessageEntity]] = None,
@ -766,7 +766,7 @@ class Message(TelegramObject):
Source: https://core.telegram.org/bots/api#senddocument
:param document: File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param caption: Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing
:param parse_mode: Mode for parsing entities in the document caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
@ -787,7 +787,7 @@ class Message(TelegramObject):
message_thread_id=self.message_thread_id if self.is_topic_message else None,
reply_to_message_id=self.message_id,
document=document,
thumb=thumb,
thumbnail=thumbnail,
caption=caption,
parse_mode=parse_mode,
caption_entities=caption_entities,
@ -802,7 +802,7 @@ class Message(TelegramObject):
def answer_document(
self,
document: Union[InputFile, str],
thumb: Optional[Union[InputFile, str]] = None,
thumbnail: Optional[Union[InputFile, str]] = None,
caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET,
caption_entities: Optional[List[MessageEntity]] = None,
@ -828,7 +828,7 @@ class Message(TelegramObject):
Source: https://core.telegram.org/bots/api#senddocument
:param document: File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param caption: Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing
:param parse_mode: Mode for parsing entities in the document caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
@ -849,7 +849,7 @@ class Message(TelegramObject):
chat_id=self.chat.id,
message_thread_id=self.message_thread_id if self.is_topic_message else None,
document=document,
thumb=thumb,
thumbnail=thumbnail,
caption=caption,
parse_mode=parse_mode,
caption_entities=caption_entities,
@ -1865,6 +1865,7 @@ class Message(TelegramObject):
def reply_sticker(
self,
sticker: Union[InputFile, str],
emoji: Optional[str] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
allow_sending_without_reply: Optional[bool] = None,
@ -1885,7 +1886,8 @@ class Message(TelegramObject):
Source: https://core.telegram.org/bots/api#sendsticker
:param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
:param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.
:param emoji: Emoji associated with the sticker; only for just uploaded stickers
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving
:param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
@ -1902,6 +1904,7 @@ class Message(TelegramObject):
message_thread_id=self.message_thread_id if self.is_topic_message else None,
reply_to_message_id=self.message_id,
sticker=sticker,
emoji=emoji,
disable_notification=disable_notification,
protect_content=protect_content,
allow_sending_without_reply=allow_sending_without_reply,
@ -1912,6 +1915,7 @@ class Message(TelegramObject):
def answer_sticker(
self,
sticker: Union[InputFile, str],
emoji: Optional[str] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
reply_to_message_id: Optional[int] = None,
@ -1932,7 +1936,8 @@ class Message(TelegramObject):
Source: https://core.telegram.org/bots/api#sendsticker
:param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`
:param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.
:param emoji: Emoji associated with the sticker; only for just uploaded stickers
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving
:param reply_to_message_id: If the message is a reply, ID of the original message
@ -1949,6 +1954,7 @@ class Message(TelegramObject):
chat_id=self.chat.id,
message_thread_id=self.message_thread_id if self.is_topic_message else None,
sticker=sticker,
emoji=emoji,
disable_notification=disable_notification,
protect_content=protect_content,
reply_to_message_id=reply_to_message_id,
@ -2100,7 +2106,7 @@ class Message(TelegramObject):
duration: Optional[int] = None,
width: Optional[int] = None,
height: Optional[int] = None,
thumb: Optional[Union[InputFile, str]] = None,
thumbnail: Optional[Union[InputFile, str]] = None,
caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET,
caption_entities: Optional[List[MessageEntity]] = None,
@ -2130,7 +2136,7 @@ class Message(TelegramObject):
:param duration: Duration of sent video in seconds
:param width: Video width
:param height: Video height
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing
:param parse_mode: Mode for parsing entities in the video caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
@ -2155,7 +2161,7 @@ class Message(TelegramObject):
duration=duration,
width=width,
height=height,
thumb=thumb,
thumbnail=thumbnail,
caption=caption,
parse_mode=parse_mode,
caption_entities=caption_entities,
@ -2174,7 +2180,7 @@ class Message(TelegramObject):
duration: Optional[int] = None,
width: Optional[int] = None,
height: Optional[int] = None,
thumb: Optional[Union[InputFile, str]] = None,
thumbnail: Optional[Union[InputFile, str]] = None,
caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET,
caption_entities: Optional[List[MessageEntity]] = None,
@ -2204,7 +2210,7 @@ class Message(TelegramObject):
:param duration: Duration of sent video in seconds
:param width: Video width
:param height: Video height
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing
:param parse_mode: Mode for parsing entities in the video caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
@ -2229,7 +2235,7 @@ class Message(TelegramObject):
duration=duration,
width=width,
height=height,
thumb=thumb,
thumbnail=thumbnail,
caption=caption,
parse_mode=parse_mode,
caption_entities=caption_entities,
@ -2248,7 +2254,7 @@ class Message(TelegramObject):
video_note: Union[InputFile, str],
duration: Optional[int] = None,
length: Optional[int] = None,
thumb: Optional[Union[InputFile, str]] = None,
thumbnail: Optional[Union[InputFile, str]] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
allow_sending_without_reply: Optional[bool] = None,
@ -2272,7 +2278,7 @@ class Message(TelegramObject):
:param video_note: Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`. Sending video notes by a URL is currently unsupported
:param duration: Duration of sent video in seconds
:param length: Video width and height, i.e. diameter of the video message
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving
:param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found
@ -2291,7 +2297,7 @@ class Message(TelegramObject):
video_note=video_note,
duration=duration,
length=length,
thumb=thumb,
thumbnail=thumbnail,
disable_notification=disable_notification,
protect_content=protect_content,
allow_sending_without_reply=allow_sending_without_reply,
@ -2304,7 +2310,7 @@ class Message(TelegramObject):
video_note: Union[InputFile, str],
duration: Optional[int] = None,
length: Optional[int] = None,
thumb: Optional[Union[InputFile, str]] = None,
thumbnail: Optional[Union[InputFile, str]] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = None,
reply_to_message_id: Optional[int] = None,
@ -2328,7 +2334,7 @@ class Message(TelegramObject):
:param video_note: Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`. Sending video notes by a URL is currently unsupported
:param duration: Duration of sent video in seconds
:param length: Video width and height, i.e. diameter of the video message
:param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`
:param disable_notification: Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.
:param protect_content: Protects the contents of the sent message from forwarding and saving
:param reply_to_message_id: If the message is a reply, ID of the original message
@ -2347,7 +2353,7 @@ class Message(TelegramObject):
video_note=video_note,
duration=duration,
length=length,
thumb=thumb,
thumbnail=thumbnail,
disable_notification=disable_notification,
protect_content=protect_content,
reply_to_message_id=reply_to_message_id,

View file

@ -32,7 +32,7 @@ class Sticker(TelegramObject):
""":code:`True`, if the sticker is `animated <https://telegram.org/blog/animated-stickers>`_"""
is_video: bool
""":code:`True`, if the sticker is a `video sticker <https://telegram.org/blog/video-stickers-better-reactions>`_"""
thumb: Optional[PhotoSize] = None
thumbnail: Optional[PhotoSize] = None
"""*Optional*. Sticker thumbnail in the .WEBP or .JPG format"""
emoji: Optional[str] = None
"""*Optional*. Emoji associated with the sticker"""
@ -44,6 +44,8 @@ class Sticker(TelegramObject):
"""*Optional*. For mask stickers, the position where the mask should be placed"""
custom_emoji_id: Optional[str] = None
"""*Optional*. For custom emoji stickers, unique identifier of the custom emoji"""
needs_repainting: Optional[bool] = None
"""*Optional*. :code:`True`, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places"""
file_size: Optional[int] = None
"""*Optional*. File size in bytes"""

View file

@ -28,5 +28,5 @@ class StickerSet(TelegramObject):
""":code:`True`, if the sticker set contains `video stickers <https://telegram.org/blog/video-stickers-better-reactions>`_"""
stickers: List[Sticker]
"""List of all set stickers"""
thumb: Optional[PhotoSize] = None
thumbnail: Optional[PhotoSize] = None
"""*Optional*. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format"""

View file

@ -25,7 +25,7 @@ class Video(TelegramObject):
"""Video height as defined by sender"""
duration: int
"""Duration of the video in seconds as defined by sender"""
thumb: Optional[PhotoSize] = None
thumbnail: Optional[PhotoSize] = None
"""*Optional*. Video thumbnail"""
file_name: Optional[str] = None
"""*Optional*. Original filename as defined by sender"""

View file

@ -23,7 +23,7 @@ class VideoNote(TelegramObject):
"""Video width and height (diameter of the video message) as defined by sender"""
duration: int
"""Duration of the video in seconds as defined by sender"""
thumb: Optional[PhotoSize] = None
thumbnail: Optional[PhotoSize] = None
"""*Optional*. Video thumbnail"""
file_size: Optional[int] = None
"""*Optional*. File size in bytes"""