Skip to content

Commit d9dbdd3

Browse files
Deshdeepak1alissonlauffer
authored andcommitted
Add file_name where missing and pass thumb as Union
1 parent b41b574 commit d9dbdd3

1 file changed

Lines changed: 35 additions & 12 deletions

File tree

pyrogram/types/messages_and_media/message.py

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,8 @@ async def reply_animation(
10091009
duration: int = 0,
10101010
width: int = 0,
10111011
height: int = 0,
1012-
thumb: str = None,
1012+
thumb: Union[str, BinaryIO] = None,
1013+
file_name: str = None,
10131014
disable_notification: bool = None,
10141015
reply_markup: Union[
10151016
"types.InlineKeyboardMarkup",
@@ -1071,12 +1072,16 @@ async def reply_animation(
10711072
height (``int``, *optional*):
10721073
Animation height.
10731074
1074-
thumb (``str``, *optional*):
1075+
thumb (``str`` | ``BinaryIO``, *optional*):
10751076
Thumbnail of the animation file sent.
10761077
The thumbnail should be in JPEG format and less than 200 KB in size.
10771078
A thumbnail's width and height should not exceed 320 pixels.
10781079
Thumbnails can't be reused and can be only uploaded as a new file.
10791080
1081+
file_name (``str``, *optional*):
1082+
File name of the animation sent.
1083+
Defaults to file's path basename.
1084+
10801085
disable_notification (``bool``, *optional*):
10811086
Sends the message silently.
10821087
Users will receive a notification with no sound.
@@ -1135,6 +1140,7 @@ async def reply_animation(
11351140
width=width,
11361141
height=height,
11371142
thumb=thumb,
1143+
file_name=file_name,
11381144
disable_notification=disable_notification,
11391145
reply_to_message_id=reply_to_message_id,
11401146
reply_markup=reply_markup,
@@ -1152,7 +1158,8 @@ async def reply_audio(
11521158
duration: int = 0,
11531159
performer: str = None,
11541160
title: str = None,
1155-
thumb: str = None,
1161+
thumb: Union[str, BinaryIO] = None,
1162+
file_name: str = None,
11561163
disable_notification: bool = None,
11571164
reply_to_message_id: int = None,
11581165
reply_markup: Union[
@@ -1211,12 +1218,16 @@ async def reply_audio(
12111218
title (``str``, *optional*):
12121219
Track name.
12131220
1214-
thumb (``str``, *optional*):
1221+
thumb (``str`` | ``BinaryIO``, *optional*):
12151222
Thumbnail of the music file album cover.
12161223
The thumbnail should be in JPEG format and less than 200 KB in size.
12171224
A thumbnail's width and height should not exceed 320 pixels.
12181225
Thumbnails can't be reused and can be only uploaded as a new file.
12191226
1227+
file_name (``str``, *optional*):
1228+
File name of the audio sent.
1229+
Defaults to file's path basename.
1230+
12201231
disable_notification (``bool``, *optional*):
12211232
Sends the message silently.
12221233
Users will receive a notification with no sound.
@@ -1274,6 +1285,7 @@ async def reply_audio(
12741285
performer=performer,
12751286
title=title,
12761287
thumb=thumb,
1288+
file_name=file_name,
12771289
disable_notification=disable_notification,
12781290
reply_to_message_id=reply_to_message_id,
12791291
reply_markup=reply_markup,
@@ -1493,7 +1505,7 @@ async def reply_document(
14931505
self,
14941506
document: Union[str, BinaryIO],
14951507
quote: bool = None,
1496-
thumb: str = None,
1508+
thumb: Union[str, BinaryIO] = None,
14971509
caption: str = "",
14981510
parse_mode: Optional["enums.ParseMode"] = None,
14991511
caption_entities: List["types.MessageEntity"] = None,
@@ -1539,7 +1551,7 @@ async def reply_document(
15391551
If *reply_to_message_id* is passed, this parameter will be ignored.
15401552
Defaults to ``True`` in group chats and ``False`` in private chats.
15411553
1542-
thumb (``str``, *optional*):
1554+
thumb (``str`` | ``BinaryIO``, *optional*):
15431555
Thumbnail of the file sent.
15441556
The thumbnail should be in JPEG format and less than 200 KB in size.
15451557
A thumbnail's width and height should not exceed 320 pixels.
@@ -1554,7 +1566,7 @@ async def reply_document(
15541566
15551567
caption_entities (List of :obj:`~pyrogram.types.MessageEntity`):
15561568
List of special entities that appear in the caption, which can be specified instead of *parse_mode*.
1557-
1569+
15581570
file_name (``str``, *optional*):
15591571
File name of the document sent.
15601572
Defaults to file's path basename.
@@ -1841,7 +1853,12 @@ async def reply_location(
18411853

18421854
async def reply_media_group(
18431855
self,
1844-
media: List[Union["types.InputMediaPhoto", "types.InputMediaVideo"]],
1856+
media: List[Union[
1857+
"types.InputMediaPhoto",
1858+
"types.InputMediaVideo",
1859+
"types.InputMediaAudio",
1860+
"types.InputMediaDocument"
1861+
]],
18451862
quote: bool = None,
18461863
disable_notification: bool = None,
18471864
reply_to_message_id: int = None
@@ -2383,7 +2400,8 @@ async def reply_video(
23832400
duration: int = 0,
23842401
width: int = 0,
23852402
height: int = 0,
2386-
thumb: str = None,
2403+
thumb: Union[str, BinaryIO] = None,
2404+
file_name: str = None,
23872405
supports_streaming: bool = True,
23882406
disable_notification: bool = None,
23892407
reply_to_message_id: int = None,
@@ -2451,12 +2469,16 @@ async def reply_video(
24512469
height (``int``, *optional*):
24522470
Video height.
24532471
2454-
thumb (``str``, *optional*):
2472+
thumb (``str`` | ``BinaryIO``, *optional*):
24552473
Thumbnail of the video sent.
24562474
The thumbnail should be in JPEG format and less than 200 KB in size.
24572475
A thumbnail's width and height should not exceed 320 pixels.
24582476
Thumbnails can't be reused and can be only uploaded as a new file.
24592477
2478+
file_name (``str``, *optional*):
2479+
File name of the video sent.
2480+
Defaults to file's path basename.
2481+
24602482
supports_streaming (``bool``, *optional*):
24612483
Pass True, if the uploaded video is suitable for streaming.
24622484
@@ -2519,6 +2541,7 @@ async def reply_video(
25192541
width=width,
25202542
height=height,
25212543
thumb=thumb,
2544+
file_name=file_name,
25222545
supports_streaming=supports_streaming,
25232546
disable_notification=disable_notification,
25242547
reply_to_message_id=reply_to_message_id,
@@ -2533,7 +2556,7 @@ async def reply_video_note(
25332556
quote: bool = None,
25342557
duration: int = 0,
25352558
length: int = 1,
2536-
thumb: str = None,
2559+
thumb: Union[str, BinaryIO] = None,
25372560
disable_notification: bool = None,
25382561
reply_to_message_id: int = None,
25392562
reply_markup: Union[
@@ -2579,7 +2602,7 @@ async def reply_video_note(
25792602
length (``int``, *optional*):
25802603
Video width and height.
25812604
2582-
thumb (``str``, *optional*):
2605+
thumb (``str`` | ``BinaryIO``, *optional*):
25832606
Thumbnail of the video sent.
25842607
The thumbnail should be in JPEG format and less than 200 KB in size.
25852608
A thumbnail's width and height should not exceed 320 pixels.

0 commit comments

Comments
 (0)