Add file_name where missing and pass thumb as Union

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
Deshdeepak 2021-07-27 12:32:00 +05:30 committed by wulan17
parent 9bb83e9319
commit 08248222bb
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5

View file

@ -1119,7 +1119,8 @@ class Message(Object, Update):
duration: int = 0, duration: int = 0,
width: int = 0, width: int = 0,
height: int = 0, height: int = 0,
thumb: str = None, thumb: Union[str, BinaryIO] = None,
file_name: str = None,
disable_notification: bool = None, disable_notification: bool = None,
reply_markup: Union[ reply_markup: Union[
"types.InlineKeyboardMarkup", "types.InlineKeyboardMarkup",
@ -1181,12 +1182,16 @@ class Message(Object, Update):
height (``int``, *optional*): height (``int``, *optional*):
Animation height. Animation height.
thumb (``str``, *optional*): thumb (``str`` | ``BinaryIO``, *optional*):
Thumbnail of the animation file sent. Thumbnail of the animation file sent.
The thumbnail should be in JPEG format and less than 200 KB in size. The thumbnail should be in JPEG format and less than 200 KB in size.
A thumbnail's width and height should not exceed 320 pixels. A thumbnail's width and height should not exceed 320 pixels.
Thumbnails can't be reused and can be only uploaded as a new file. Thumbnails can't be reused and can be only uploaded as a new file.
file_name (``str``, *optional*):
File name of the animation sent.
Defaults to file's path basename.
disable_notification (``bool``, *optional*): disable_notification (``bool``, *optional*):
Sends the message silently. Sends the message silently.
Users will receive a notification with no sound. Users will receive a notification with no sound.
@ -1245,6 +1250,7 @@ class Message(Object, Update):
width=width, width=width,
height=height, height=height,
thumb=thumb, thumb=thumb,
file_name=file_name,
disable_notification=disable_notification, disable_notification=disable_notification,
reply_to_message_id=reply_to_message_id, reply_to_message_id=reply_to_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
@ -1262,7 +1268,8 @@ class Message(Object, Update):
duration: int = 0, duration: int = 0,
performer: str = None, performer: str = None,
title: str = None, title: str = None,
thumb: str = None, thumb: Union[str, BinaryIO] = None,
file_name: str = None,
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None, reply_to_message_id: int = None,
reply_markup: Union[ reply_markup: Union[
@ -1321,12 +1328,16 @@ class Message(Object, Update):
title (``str``, *optional*): title (``str``, *optional*):
Track name. Track name.
thumb (``str``, *optional*): thumb (``str`` | ``BinaryIO``, *optional*):
Thumbnail of the music file album cover. Thumbnail of the music file album cover.
The thumbnail should be in JPEG format and less than 200 KB in size. The thumbnail should be in JPEG format and less than 200 KB in size.
A thumbnail's width and height should not exceed 320 pixels. A thumbnail's width and height should not exceed 320 pixels.
Thumbnails can't be reused and can be only uploaded as a new file. Thumbnails can't be reused and can be only uploaded as a new file.
file_name (``str``, *optional*):
File name of the audio sent.
Defaults to file's path basename.
disable_notification (``bool``, *optional*): disable_notification (``bool``, *optional*):
Sends the message silently. Sends the message silently.
Users will receive a notification with no sound. Users will receive a notification with no sound.
@ -1384,6 +1395,7 @@ class Message(Object, Update):
performer=performer, performer=performer,
title=title, title=title,
thumb=thumb, thumb=thumb,
file_name=file_name,
disable_notification=disable_notification, disable_notification=disable_notification,
reply_to_message_id=reply_to_message_id, reply_to_message_id=reply_to_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
@ -1603,7 +1615,7 @@ class Message(Object, Update):
self, self,
document: Union[str, BinaryIO], document: Union[str, BinaryIO],
quote: bool = None, quote: bool = None,
thumb: str = None, thumb: Union[str, BinaryIO] = None,
caption: str = "", caption: str = "",
parse_mode: Optional["enums.ParseMode"] = None, parse_mode: Optional["enums.ParseMode"] = None,
caption_entities: List["types.MessageEntity"] = None, caption_entities: List["types.MessageEntity"] = None,
@ -1649,7 +1661,7 @@ class Message(Object, Update):
If *reply_to_message_id* is passed, this parameter will be ignored. If *reply_to_message_id* is passed, this parameter will be ignored.
Defaults to ``True`` in group chats and ``False`` in private chats. Defaults to ``True`` in group chats and ``False`` in private chats.
thumb (``str``, *optional*): thumb (``str`` | ``BinaryIO``, *optional*):
Thumbnail of the file sent. Thumbnail of the file sent.
The thumbnail should be in JPEG format and less than 200 KB in size. The thumbnail should be in JPEG format and less than 200 KB in size.
A thumbnail's width and height should not exceed 320 pixels. A thumbnail's width and height should not exceed 320 pixels.
@ -1953,7 +1965,12 @@ class Message(Object, Update):
async def reply_media_group( async def reply_media_group(
self, self,
media: List[Union["types.InputMediaPhoto", "types.InputMediaVideo"]], media: List[Union[
"types.InputMediaPhoto",
"types.InputMediaVideo",
"types.InputMediaAudio",
"types.InputMediaDocument"
]],
quote: bool = None, quote: bool = None,
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None reply_to_message_id: int = None
@ -2495,7 +2512,8 @@ class Message(Object, Update):
duration: int = 0, duration: int = 0,
width: int = 0, width: int = 0,
height: int = 0, height: int = 0,
thumb: str = None, thumb: Union[str, BinaryIO] = None,
file_name: str = None,
supports_streaming: bool = True, supports_streaming: bool = True,
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None, reply_to_message_id: int = None,
@ -2563,12 +2581,16 @@ class Message(Object, Update):
height (``int``, *optional*): height (``int``, *optional*):
Video height. Video height.
thumb (``str``, *optional*): thumb (``str`` | ``BinaryIO``, *optional*):
Thumbnail of the video sent. Thumbnail of the video sent.
The thumbnail should be in JPEG format and less than 200 KB in size. The thumbnail should be in JPEG format and less than 200 KB in size.
A thumbnail's width and height should not exceed 320 pixels. A thumbnail's width and height should not exceed 320 pixels.
Thumbnails can't be reused and can be only uploaded as a new file. Thumbnails can't be reused and can be only uploaded as a new file.
file_name (``str``, *optional*):
File name of the video sent.
Defaults to file's path basename.
supports_streaming (``bool``, *optional*): supports_streaming (``bool``, *optional*):
Pass True, if the uploaded video is suitable for streaming. Pass True, if the uploaded video is suitable for streaming.
@ -2631,6 +2653,7 @@ class Message(Object, Update):
width=width, width=width,
height=height, height=height,
thumb=thumb, thumb=thumb,
file_name=file_name,
supports_streaming=supports_streaming, supports_streaming=supports_streaming,
disable_notification=disable_notification, disable_notification=disable_notification,
reply_to_message_id=reply_to_message_id, reply_to_message_id=reply_to_message_id,
@ -2645,7 +2668,7 @@ class Message(Object, Update):
quote: bool = None, quote: bool = None,
duration: int = 0, duration: int = 0,
length: int = 1, length: int = 1,
thumb: str = None, thumb: Union[str, BinaryIO] = None,
disable_notification: bool = None, disable_notification: bool = None,
reply_to_message_id: int = None, reply_to_message_id: int = None,
reply_markup: Union[ reply_markup: Union[
@ -2691,7 +2714,7 @@ class Message(Object, Update):
length (``int``, *optional*): length (``int``, *optional*):
Video width and height. Video width and height.
thumb (``str``, *optional*): thumb (``str`` | ``BinaryIO``, *optional*):
Thumbnail of the video sent. Thumbnail of the video sent.
The thumbnail should be in JPEG format and less than 200 KB in size. The thumbnail should be in JPEG format and less than 200 KB in size.
A thumbnail's width and height should not exceed 320 pixels. A thumbnail's width and height should not exceed 320 pixels.