diff --git a/pyrogram/types/messages_and_media/message.py b/pyrogram/types/messages_and_media/message.py index 9763c3de..3e393b2c 100644 --- a/pyrogram/types/messages_and_media/message.py +++ b/pyrogram/types/messages_and_media/message.py @@ -1004,7 +1004,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", @@ -1066,12 +1067,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. @@ -1130,6 +1135,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, @@ -1147,7 +1153,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[ @@ -1206,12 +1213,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. @@ -1269,6 +1280,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, @@ -1488,7 +1500,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, @@ -1534,7 +1546,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. @@ -1549,7 +1561,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. @@ -1836,7 +1848,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 @@ -2378,7 +2395,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, @@ -2446,12 +2464,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. @@ -2514,6 +2536,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, @@ -2528,7 +2551,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[ @@ -2574,7 +2597,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.