Update thumbnail type to InputFile only (#1374)

* Update thumbnail type to InputFile only

The thumbnail's type restriction has been changed in several methods and types. Previously, it accepted Union[InputFile, str], allowing both InputFile instances and strings. Now it's changed to accept only InputFile instances. This change enhances meaning of the thumbnail fields in due to Bot API accepts only InputFile instances.

* Added changelog

* Fixed typehints
This commit is contained in:
Alex Root Junior 2023-11-24 21:10:02 +02:00 committed by GitHub
parent 09af2a1c8b
commit c8dff11d1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 106 additions and 51 deletions

View file

@ -3,3 +3,9 @@ annotations:
value: UNSET_PARSE_MODE value: UNSET_PARSE_MODE
protect_content: protect_content:
value: UNSET_PROTECT_CONTENT value: UNSET_PROTECT_CONTENT
thumbnail:
parsed_type:
type: entity
references:
category: types
name: InputFile

View file

@ -3,3 +3,9 @@ annotations:
value: UNSET_PARSE_MODE value: UNSET_PARSE_MODE
protect_content: protect_content:
value: UNSET_PROTECT_CONTENT value: UNSET_PROTECT_CONTENT
thumbnail:
parsed_type:
type: entity
references:
category: types
name: InputFile

View file

@ -3,3 +3,9 @@ annotations:
value: UNSET_PARSE_MODE value: UNSET_PARSE_MODE
protect_content: protect_content:
value: UNSET_PROTECT_CONTENT value: UNSET_PROTECT_CONTENT
thumbnail:
parsed_type:
type: entity
references:
category: types
name: InputFile

View file

@ -3,3 +3,9 @@ annotations:
value: UNSET_PARSE_MODE value: UNSET_PARSE_MODE
protect_content: protect_content:
value: UNSET_PROTECT_CONTENT value: UNSET_PROTECT_CONTENT
thumbnail:
parsed_type:
type: entity
references:
category: types
name: InputFile

View file

@ -1,3 +1,9 @@
annotations: annotations:
protect_content: protect_content:
value: UNSET_PROTECT_CONTENT value: UNSET_PROTECT_CONTENT
thumbnail:
parsed_type:
type: entity
references:
category: types
name: InputFile

View file

@ -9,5 +9,11 @@ annotations:
references: references:
category: types category: types
name: InputFile name: InputFile
thumbnail:
parsed_type:
type: entity
references:
category: types
name: InputFile
parse_mode: parse_mode:
value: UNSET_PARSE_MODE value: UNSET_PARSE_MODE

View file

@ -9,5 +9,11 @@ annotations:
references: references:
category: types category: types
name: InputFile name: InputFile
thumbnail:
parsed_type:
type: entity
references:
category: types
name: InputFile
parse_mode: parse_mode:
value: UNSET_PARSE_MODE value: UNSET_PARSE_MODE

View file

@ -9,5 +9,11 @@ annotations:
references: references:
category: types category: types
name: InputFile name: InputFile
thumbnail:
parsed_type:
type: entity
references:
category: types
name: InputFile
parse_mode: parse_mode:
value: UNSET_PARSE_MODE value: UNSET_PARSE_MODE

View file

@ -9,5 +9,11 @@ annotations:
references: references:
category: types category: types
name: InputFile name: InputFile
thumbnail:
parsed_type:
type: entity
references:
category: types
name: InputFile
parse_mode: parse_mode:
value: UNSET_PARSE_MODE value: UNSET_PARSE_MODE

1
CHANGES/1372.misc.rst Normal file
View file

@ -0,0 +1 @@
Updated :code:`thumbnail` fields type to :code:`InputFile` only

View file

@ -2120,7 +2120,7 @@ class Bot:
duration: Optional[int] = None, duration: Optional[int] = None,
width: Optional[int] = None, width: Optional[int] = None,
height: Optional[int] = None, height: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -2190,7 +2190,7 @@ class Bot:
duration: Optional[int] = None, duration: Optional[int] = None,
performer: Optional[str] = None, performer: Optional[str] = None,
title: Optional[str] = None, title: Optional[str] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
reply_to_message_id: Optional[int] = None, reply_to_message_id: Optional[int] = None,
@ -2374,7 +2374,7 @@ class Bot:
chat_id: Union[int, str], chat_id: Union[int, str],
document: Union[InputFile, str], document: Union[InputFile, str],
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -2966,7 +2966,7 @@ class Bot:
duration: Optional[int] = None, duration: Optional[int] = None,
width: Optional[int] = None, width: Optional[int] = None,
height: Optional[int] = None, height: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -3035,7 +3035,7 @@ class Bot:
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
duration: Optional[int] = None, duration: Optional[int] = None,
length: Optional[int] = None, length: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
reply_to_message_id: Optional[int] = None, reply_to_message_id: Optional[int] = None,

View file

@ -38,7 +38,7 @@ class SendAnimation(TelegramMethod[Message]):
"""Animation width""" """Animation width"""
height: Optional[int] = None height: Optional[int] = None
"""Animation height""" """Animation height"""
thumbnail: Optional[Union[InputFile, str]] = None thumbnail: Optional[InputFile] = None
"""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>`""" """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 caption: Optional[str] = None
"""Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing""" """Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing"""
@ -74,7 +74,7 @@ class SendAnimation(TelegramMethod[Message]):
duration: Optional[int] = None, duration: Optional[int] = None,
width: Optional[int] = None, width: Optional[int] = None,
height: Optional[int] = None, height: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,

View file

@ -45,7 +45,7 @@ class SendAudio(TelegramMethod[Message]):
"""Performer""" """Performer"""
title: Optional[str] = None title: Optional[str] = None
"""Track name""" """Track name"""
thumbnail: Optional[Union[InputFile, str]] = None thumbnail: Optional[InputFile] = None
"""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>`""" """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>`"""
disable_notification: Optional[bool] = None disable_notification: Optional[bool] = None
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.""" """Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
@ -76,7 +76,7 @@ class SendAudio(TelegramMethod[Message]):
duration: Optional[int] = None, duration: Optional[int] = None,
performer: Optional[str] = None, performer: Optional[str] = None,
title: Optional[str] = None, title: Optional[str] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
reply_to_message_id: Optional[int] = None, reply_to_message_id: Optional[int] = None,

View file

@ -32,7 +32,7 @@ class SendDocument(TelegramMethod[Message]):
"""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>`""" """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>`"""
message_thread_id: Optional[int] = None message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
thumbnail: Optional[Union[InputFile, str]] = None thumbnail: Optional[InputFile] = None
"""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>`""" """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 caption: Optional[str] = None
"""Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing""" """Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing"""
@ -65,7 +65,7 @@ class SendDocument(TelegramMethod[Message]):
chat_id: Union[int, str], chat_id: Union[int, str],
document: Union[InputFile, str], document: Union[InputFile, str],
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,

View file

@ -38,7 +38,7 @@ class SendVideo(TelegramMethod[Message]):
"""Video width""" """Video width"""
height: Optional[int] = None height: Optional[int] = None
"""Video height""" """Video height"""
thumbnail: Optional[Union[InputFile, str]] = None thumbnail: Optional[InputFile] = None
"""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>`""" """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 caption: Optional[str] = None
"""Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing""" """Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing"""
@ -76,7 +76,7 @@ class SendVideo(TelegramMethod[Message]):
duration: Optional[int] = None, duration: Optional[int] = None,
width: Optional[int] = None, width: Optional[int] = None,
height: Optional[int] = None, height: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,

View file

@ -34,7 +34,7 @@ class SendVideoNote(TelegramMethod[Message]):
"""Duration of sent video in seconds""" """Duration of sent video in seconds"""
length: Optional[int] = None length: Optional[int] = None
"""Video width and height, i.e. diameter of the video message""" """Video width and height, i.e. diameter of the video message"""
thumbnail: Optional[Union[InputFile, str]] = None thumbnail: Optional[InputFile] = None
"""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>`""" """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>`"""
disable_notification: Optional[bool] = None disable_notification: Optional[bool] = None
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound.""" """Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
@ -61,7 +61,7 @@ class SendVideoNote(TelegramMethod[Message]):
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
duration: Optional[int] = None, duration: Optional[int] = None,
length: Optional[int] = None, length: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
reply_to_message_id: Optional[int] = None, reply_to_message_id: Optional[int] = None,

View file

@ -279,7 +279,7 @@ class ChatJoinRequest(TelegramObject):
duration: Optional[int] = None, duration: Optional[int] = None,
width: Optional[int] = None, width: Optional[int] = None,
height: Optional[int] = None, height: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -352,7 +352,7 @@ class ChatJoinRequest(TelegramObject):
duration: Optional[int] = None, duration: Optional[int] = None,
width: Optional[int] = None, width: Optional[int] = None,
height: Optional[int] = None, height: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -428,7 +428,7 @@ class ChatJoinRequest(TelegramObject):
duration: Optional[int] = None, duration: Optional[int] = None,
performer: Optional[str] = None, performer: Optional[str] = None,
title: Optional[str] = None, title: Optional[str] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
reply_to_message_id: Optional[int] = None, reply_to_message_id: Optional[int] = None,
@ -499,7 +499,7 @@ class ChatJoinRequest(TelegramObject):
duration: Optional[int] = None, duration: Optional[int] = None,
performer: Optional[str] = None, performer: Optional[str] = None,
title: Optional[str] = None, title: Optional[str] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
reply_to_message_id: Optional[int] = None, reply_to_message_id: Optional[int] = None,
@ -680,7 +680,7 @@ class ChatJoinRequest(TelegramObject):
self, self,
document: Union[InputFile, str], document: Union[InputFile, str],
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -744,7 +744,7 @@ class ChatJoinRequest(TelegramObject):
self, self,
document: Union[InputFile, str], document: Union[InputFile, str],
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -1963,7 +1963,7 @@ class ChatJoinRequest(TelegramObject):
duration: Optional[int] = None, duration: Optional[int] = None,
width: Optional[int] = None, width: Optional[int] = None,
height: Optional[int] = None, height: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -2039,7 +2039,7 @@ class ChatJoinRequest(TelegramObject):
duration: Optional[int] = None, duration: Optional[int] = None,
width: Optional[int] = None, width: Optional[int] = None,
height: Optional[int] = None, height: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -2114,7 +2114,7 @@ class ChatJoinRequest(TelegramObject):
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
duration: Optional[int] = None, duration: Optional[int] = None,
length: Optional[int] = None, length: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
reply_to_message_id: Optional[int] = None, reply_to_message_id: Optional[int] = None,
@ -2172,7 +2172,7 @@ class ChatJoinRequest(TelegramObject):
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
duration: Optional[int] = None, duration: Optional[int] = None,
length: Optional[int] = None, length: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
reply_to_message_id: Optional[int] = None, reply_to_message_id: Optional[int] = None,

View file

@ -201,7 +201,7 @@ class ChatMemberUpdated(TelegramObject):
duration: Optional[int] = None, duration: Optional[int] = None,
width: Optional[int] = None, width: Optional[int] = None,
height: Optional[int] = None, height: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -277,7 +277,7 @@ class ChatMemberUpdated(TelegramObject):
duration: Optional[int] = None, duration: Optional[int] = None,
performer: Optional[str] = None, performer: Optional[str] = None,
title: Optional[str] = None, title: Optional[str] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
reply_to_message_id: Optional[int] = None, reply_to_message_id: Optional[int] = None,
@ -400,7 +400,7 @@ class ChatMemberUpdated(TelegramObject):
self, self,
document: Union[InputFile, str], document: Union[InputFile, str],
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -1043,7 +1043,7 @@ class ChatMemberUpdated(TelegramObject):
duration: Optional[int] = None, duration: Optional[int] = None,
width: Optional[int] = None, width: Optional[int] = None,
height: Optional[int] = None, height: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -1118,7 +1118,7 @@ class ChatMemberUpdated(TelegramObject):
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
duration: Optional[int] = None, duration: Optional[int] = None,
length: Optional[int] = None, length: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
reply_to_message_id: Optional[int] = None, reply_to_message_id: Optional[int] = None,

View file

@ -22,7 +22,7 @@ class InputMediaAnimation(InputMedia):
"""Type of the result, must be *animation*""" """Type of the result, must be *animation*"""
media: Union[str, InputFile] 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>`""" """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>`"""
thumbnail: Optional[Union[InputFile, str]] = None thumbnail: Optional[InputFile] = 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>`""" """*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 caption: Optional[str] = None
"""*Optional*. Caption of the animation to be sent, 0-1024 characters after entities parsing""" """*Optional*. Caption of the animation to be sent, 0-1024 characters after entities parsing"""
@ -48,7 +48,7 @@ class InputMediaAnimation(InputMedia):
*, *,
type: Literal[InputMediaType.ANIMATION] = InputMediaType.ANIMATION, type: Literal[InputMediaType.ANIMATION] = InputMediaType.ANIMATION,
media: Union[str, InputFile], media: Union[str, InputFile],
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,

View file

@ -22,7 +22,7 @@ class InputMediaAudio(InputMedia):
"""Type of the result, must be *audio*""" """Type of the result, must be *audio*"""
media: Union[str, InputFile] 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>`""" """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>`"""
thumbnail: Optional[Union[InputFile, str]] = None thumbnail: Optional[InputFile] = 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>`""" """*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 caption: Optional[str] = None
"""*Optional*. Caption of the audio to be sent, 0-1024 characters after entities parsing""" """*Optional*. Caption of the audio to be sent, 0-1024 characters after entities parsing"""
@ -46,7 +46,7 @@ class InputMediaAudio(InputMedia):
*, *,
type: Literal[InputMediaType.AUDIO] = InputMediaType.AUDIO, type: Literal[InputMediaType.AUDIO] = InputMediaType.AUDIO,
media: Union[str, InputFile], media: Union[str, InputFile],
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,

View file

@ -22,7 +22,7 @@ class InputMediaDocument(InputMedia):
"""Type of the result, must be *document*""" """Type of the result, must be *document*"""
media: Union[str, InputFile] 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>`""" """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>`"""
thumbnail: Optional[Union[InputFile, str]] = None thumbnail: Optional[InputFile] = 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>`""" """*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 caption: Optional[str] = None
"""*Optional*. Caption of the document to be sent, 0-1024 characters after entities parsing""" """*Optional*. Caption of the document to be sent, 0-1024 characters after entities parsing"""
@ -42,7 +42,7 @@ class InputMediaDocument(InputMedia):
*, *,
type: Literal[InputMediaType.DOCUMENT] = InputMediaType.DOCUMENT, type: Literal[InputMediaType.DOCUMENT] = InputMediaType.DOCUMENT,
media: Union[str, InputFile], media: Union[str, InputFile],
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,

View file

@ -22,7 +22,7 @@ class InputMediaVideo(InputMedia):
"""Type of the result, must be *video*""" """Type of the result, must be *video*"""
media: Union[str, InputFile] 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>`""" """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>`"""
thumbnail: Optional[Union[InputFile, str]] = None thumbnail: Optional[InputFile] = 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>`""" """*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 caption: Optional[str] = None
"""*Optional*. Caption of the video to be sent, 0-1024 characters after entities parsing""" """*Optional*. Caption of the video to be sent, 0-1024 characters after entities parsing"""
@ -50,7 +50,7 @@ class InputMediaVideo(InputMedia):
*, *,
type: Literal[InputMediaType.VIDEO] = InputMediaType.VIDEO, type: Literal[InputMediaType.VIDEO] = InputMediaType.VIDEO,
media: Union[str, InputFile], media: Union[str, InputFile],
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,

View file

@ -526,7 +526,7 @@ class Message(TelegramObject):
duration: Optional[int] = None, duration: Optional[int] = None,
width: Optional[int] = None, width: Optional[int] = None,
height: Optional[int] = None, height: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -601,7 +601,7 @@ class Message(TelegramObject):
duration: Optional[int] = None, duration: Optional[int] = None,
width: Optional[int] = None, width: Optional[int] = None,
height: Optional[int] = None, height: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -680,7 +680,7 @@ class Message(TelegramObject):
duration: Optional[int] = None, duration: Optional[int] = None,
performer: Optional[str] = None, performer: Optional[str] = None,
title: Optional[str] = None, title: Optional[str] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
allow_sending_without_reply: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None,
@ -753,7 +753,7 @@ class Message(TelegramObject):
duration: Optional[int] = None, duration: Optional[int] = None,
performer: Optional[str] = None, performer: Optional[str] = None,
title: Optional[str] = None, title: Optional[str] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
reply_to_message_id: Optional[int] = None, reply_to_message_id: Optional[int] = None,
@ -942,7 +942,7 @@ class Message(TelegramObject):
def reply_document( def reply_document(
self, self,
document: Union[InputFile, str], document: Union[InputFile, str],
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -1008,7 +1008,7 @@ class Message(TelegramObject):
def answer_document( def answer_document(
self, self,
document: Union[InputFile, str], document: Union[InputFile, str],
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -2396,7 +2396,7 @@ class Message(TelegramObject):
duration: Optional[int] = None, duration: Optional[int] = None,
width: Optional[int] = None, width: Optional[int] = None,
height: Optional[int] = None, height: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -2474,7 +2474,7 @@ class Message(TelegramObject):
duration: Optional[int] = None, duration: Optional[int] = None,
width: Optional[int] = None, width: Optional[int] = None,
height: Optional[int] = None, height: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -2552,7 +2552,7 @@ class Message(TelegramObject):
video_note: Union[InputFile, str], video_note: Union[InputFile, str],
duration: Optional[int] = None, duration: Optional[int] = None,
length: Optional[int] = None, length: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
allow_sending_without_reply: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None,
@ -2612,7 +2612,7 @@ class Message(TelegramObject):
video_note: Union[InputFile, str], video_note: Union[InputFile, str],
duration: Optional[int] = None, duration: Optional[int] = None,
length: Optional[int] = None, length: Optional[int] = None,
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
disable_notification: Optional[bool] = None, disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
reply_to_message_id: Optional[int] = None, reply_to_message_id: Optional[int] = None,

View file

@ -145,7 +145,7 @@ class MediaGroupBuilder:
def add_audio( def add_audio(
self, self,
media: Union[str, InputFile], media: Union[str, InputFile],
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -234,7 +234,7 @@ class MediaGroupBuilder:
def add_video( def add_video(
self, self,
media: Union[str, InputFile], media: Union[str, InputFile],
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,
@ -296,7 +296,7 @@ class MediaGroupBuilder:
def add_document( def add_document(
self, self,
media: Union[str, InputFile], media: Union[str, InputFile],
thumbnail: Optional[Union[InputFile, str]] = None, thumbnail: Optional[InputFile] = None,
caption: Optional[str] = None, caption: Optional[str] = None,
parse_mode: Optional[str] = UNSET_PARSE_MODE, parse_mode: Optional[str] = UNSET_PARSE_MODE,
caption_entities: Optional[List[MessageEntity]] = None, caption_entities: Optional[List[MessageEntity]] = None,