Skip to content

Commit 28af5e1

Browse files
committed
Add "thumb" field for all InputMedia types except Photo
1 parent 19d04ca commit 28af5e1

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

pyrogram/client/types/input_media/input_media_animation.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ class InputMediaAnimation(InputMedia):
2828
Pass a file_id as string to send a file that exists on the Telegram servers or
2929
pass a file path as string to upload a new file that exists on your local machine.
3030
31+
thumb (``str``, *optional*):
32+
Thumbnail of the animation file sent.
33+
The thumbnail should be in JPEG format and less than 200 KB in size.
34+
A thumbnail's width and height should not exceed 90 pixels.
35+
Thumbnails can't be reused and can be only uploaded as a new file.
36+
3137
caption (``str``, *optional*):
3238
Caption of the animation to be sent, 0-200 characters
3339
@@ -48,13 +54,15 @@ class InputMediaAnimation(InputMedia):
4854

4955
def __init__(self,
5056
media: str,
57+
thumb: str = None,
5158
caption: str = "",
5259
parse_mode: str = "",
5360
width: int = 0,
5461
height: int = 0,
5562
duration: int = 0):
5663
super().__init__(media, caption, parse_mode)
5764

65+
self.thumb = thumb
5866
self.width = width
5967
self.height = height
6068
self.duration = duration

pyrogram/client/types/input_media/input_media_audio.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ class InputMediaAudio(InputMedia):
2929
Pass a file_id as string to send an audio that exists on the Telegram servers or
3030
pass a file path as string to upload a new audio that exists on your local machine.
3131
32+
thumb (``str``, *optional*):
33+
Thumbnail of the music file album cover.
34+
The thumbnail should be in JPEG format and less than 200 KB in size.
35+
A thumbnail's width and height should not exceed 90 pixels.
36+
Thumbnails can't be reused and can be only uploaded as a new file.
37+
3238
caption (``str``, *optional*):
3339
Caption of the audio to be sent, 0-200 characters
3440
@@ -49,13 +55,15 @@ class InputMediaAudio(InputMedia):
4955

5056
def __init__(self,
5157
media: str,
58+
thumb: str = None,
5259
caption: str = "",
5360
parse_mode: str = "",
5461
duration: int = 0,
5562
performer: int = "",
5663
title: str = ""):
5764
super().__init__(media, caption, parse_mode)
5865

66+
self.thumb = thumb
5967
self.duration = duration
6068
self.performer = performer
6169
self.title = title

pyrogram/client/types/input_media/input_media_document.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ class InputMediaDocument(InputMedia):
2828
Pass a file_id as string to send a file that exists on the Telegram servers or
2929
pass a file path as string to upload a new file that exists on your local machine.
3030
31+
thumb (``str``):
32+
Thumbnail of the file sent.
33+
The thumbnail should be in JPEG format and less than 200 KB in size.
34+
A thumbnail's width and height should not exceed 90 pixels.
35+
Thumbnails can't be reused and can be only uploaded as a new file.
36+
3137
caption (``str``, *optional*):
3238
Caption of the document to be sent, 0-200 characters
3339
@@ -39,6 +45,9 @@ class InputMediaDocument(InputMedia):
3945

4046
def __init__(self,
4147
media: str,
48+
thumb: str = None,
4249
caption: str = "",
4350
parse_mode: str = ""):
4451
super().__init__(media, caption, parse_mode)
52+
53+
self.thumb = thumb

pyrogram/client/types/input_media/input_media_video.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ class InputMediaVideo(InputMedia):
3030
pass a file path as string to upload a new video that exists on your local machine.
3131
Sending video by a URL is currently unsupported.
3232
33+
thumb (``str``):
34+
Thumbnail of the video sent.
35+
The thumbnail should be in JPEG format and less than 200 KB in size.
36+
A thumbnail's width and height should not exceed 90 pixels.
37+
Thumbnails can't be reused and can be only uploaded as a new file.
38+
3339
caption (``str``, *optional*):
3440
Caption of the video to be sent, 0-200 characters
3541
@@ -53,6 +59,7 @@ class InputMediaVideo(InputMedia):
5359

5460
def __init__(self,
5561
media: str,
62+
thumb: str = None,
5663
caption: str = "",
5764
parse_mode: str = "",
5865
width: int = 0,
@@ -61,6 +68,7 @@ def __init__(self,
6168
supports_streaming: bool = True):
6269
super().__init__(media, caption, parse_mode)
6370

71+
self.thumb = thumb
6472
self.width = width
6573
self.height = height
6674
self.duration = duration

0 commit comments

Comments
 (0)