Skip to content

Commit

Permalink
chore(message): add file_name where missing and pass thumb as Union
Browse files Browse the repository at this point in the history
  • Loading branch information
Deshdeepak1 authored and alissonlauffer committed Sep 6, 2023
1 parent c4f7d0c commit ad8237c
Showing 1 changed file with 35 additions and 12 deletions.
47 changes: 35 additions & 12 deletions pyrogram/types/messages_and_media/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,8 @@ async def reply_animation(
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",
Expand Down Expand Up @@ -1071,12 +1072,16 @@ async def reply_animation(
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.
Expand Down Expand Up @@ -1135,6 +1140,7 @@ async def reply_animation(
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,
Expand All @@ -1152,7 +1158,8 @@ async def reply_audio(
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[
Expand Down Expand Up @@ -1211,12 +1218,16 @@ async def reply_audio(
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.
Expand Down Expand Up @@ -1274,6 +1285,7 @@ async def reply_audio(
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,
Expand Down Expand Up @@ -1493,7 +1505,7 @@ async def reply_document(
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,
Expand Down Expand Up @@ -1539,7 +1551,7 @@ async def reply_document(
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.
Expand All @@ -1554,7 +1566,7 @@ async def reply_document(
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.
Expand Down Expand Up @@ -1841,7 +1853,12 @@ async def reply_location(

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
Expand Down Expand Up @@ -2383,7 +2400,8 @@ async def reply_video(
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,
Expand Down Expand Up @@ -2451,12 +2469,16 @@ async def reply_video(
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.
Expand Down Expand Up @@ -2519,6 +2541,7 @@ async def reply_video(
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,
Expand All @@ -2533,7 +2556,7 @@ async def reply_video_note(
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[
Expand Down Expand Up @@ -2579,7 +2602,7 @@ async def reply_video_note(
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.
Expand Down

0 comments on commit ad8237c

Please sign in to comment.