diff --git a/pyrogram/types/messages_and_media/message.py b/pyrogram/types/messages_and_media/message.py index b05ae89a..7a3e1806 100644 --- a/pyrogram/types/messages_and_media/message.py +++ b/pyrogram/types/messages_and_media/message.py @@ -1119,7 +1119,8 @@ class Message(Object, Update): duration: int = 0, width: int = 0, height: int = 0, - thumb: str = None, + thumb: Union[str, BinaryIO] = None, + file_name: str = None, disable_notification: bool = None, reply_markup: Union[ "types.InlineKeyboardMarkup", @@ -1181,12 +1182,16 @@ class Message(Object, Update): height (``int``, *optional*): Animation height. - thumb (``str``, *optional*): + thumb (``str`` | ``BinaryIO``, *optional*): Thumbnail of the animation file sent. 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. 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*): Sends the message silently. Users will receive a notification with no sound. @@ -1245,6 +1250,7 @@ class Message(Object, Update): width=width, height=height, thumb=thumb, + file_name=file_name, disable_notification=disable_notification, reply_to_message_id=reply_to_message_id, reply_markup=reply_markup, @@ -1262,7 +1268,8 @@ class Message(Object, Update): duration: int = 0, performer: str = None, title: str = None, - thumb: str = None, + thumb: Union[str, BinaryIO] = None, + file_name: str = None, disable_notification: bool = None, reply_to_message_id: int = None, reply_markup: Union[ @@ -1321,12 +1328,16 @@ class Message(Object, Update): title (``str``, *optional*): Track name. - thumb (``str``, *optional*): + thumb (``str`` | ``BinaryIO``, *optional*): Thumbnail of the music file album cover. 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. 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*): Sends the message silently. Users will receive a notification with no sound. @@ -1384,6 +1395,7 @@ class Message(Object, Update): performer=performer, title=title, thumb=thumb, + file_name=file_name, disable_notification=disable_notification, reply_to_message_id=reply_to_message_id, reply_markup=reply_markup, @@ -1603,7 +1615,7 @@ class Message(Object, Update): self, document: Union[str, BinaryIO], quote: bool = None, - thumb: str = None, + thumb: Union[str, BinaryIO] = None, caption: str = "", parse_mode: Optional["enums.ParseMode"] = 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. Defaults to ``True`` in group chats and ``False`` in private chats. - thumb (``str``, *optional*): + thumb (``str`` | ``BinaryIO``, *optional*): Thumbnail of the file sent. 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. @@ -1664,7 +1676,7 @@ class Message(Object, Update): caption_entities (List of :obj:`~pyrogram.types.MessageEntity`): List of special entities that appear in the caption, which can be specified instead of *parse_mode*. - + file_name (``str``, *optional*): File name of the document sent. Defaults to file's path basename. @@ -1953,7 +1965,12 @@ class Message(Object, Update): async def reply_media_group( self, - media: List[Union["types.InputMediaPhoto", "types.InputMediaVideo"]], + media: List[Union[ + "types.InputMediaPhoto", + "types.InputMediaVideo", + "types.InputMediaAudio", + "types.InputMediaDocument" + ]], quote: bool = None, disable_notification: bool = None, reply_to_message_id: int = None @@ -2495,7 +2512,8 @@ class Message(Object, Update): duration: int = 0, width: int = 0, height: int = 0, - thumb: str = None, + thumb: Union[str, BinaryIO] = None, + file_name: str = None, supports_streaming: bool = True, disable_notification: bool = None, reply_to_message_id: int = None, @@ -2563,12 +2581,16 @@ class Message(Object, Update): height (``int``, *optional*): Video height. - thumb (``str``, *optional*): + thumb (``str`` | ``BinaryIO``, *optional*): Thumbnail of the video sent. 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. 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*): Pass True, if the uploaded video is suitable for streaming. @@ -2631,6 +2653,7 @@ class Message(Object, Update): width=width, height=height, thumb=thumb, + file_name=file_name, supports_streaming=supports_streaming, disable_notification=disable_notification, reply_to_message_id=reply_to_message_id, @@ -2645,7 +2668,7 @@ class Message(Object, Update): quote: bool = None, duration: int = 0, length: int = 1, - thumb: str = None, + thumb: Union[str, BinaryIO] = None, disable_notification: bool = None, reply_to_message_id: int = None, reply_markup: Union[ @@ -2691,7 +2714,7 @@ class Message(Object, Update): length (``int``, *optional*): Video width and height. - thumb (``str``, *optional*): + thumb (``str`` | ``BinaryIO``, *optional*): Thumbnail of the video sent. 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.