mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-31 14:25:55 +00:00
Add "thumb" field for all InputMedia types except Photo
This commit is contained in:
@@ -28,6 +28,12 @@ class InputMediaAnimation(InputMedia):
|
|||||||
Pass a file_id as string to send a file that exists on the Telegram servers or
|
Pass a file_id as string to send a file that exists on the Telegram servers or
|
||||||
pass a file path as string to upload a new file that exists on your local machine.
|
pass a file path as string to upload a new file that exists on your local machine.
|
||||||
|
|
||||||
|
thumb (``str``, *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 90 pixels.
|
||||||
|
Thumbnails can't be reused and can be only uploaded as a new file.
|
||||||
|
|
||||||
caption (``str``, *optional*):
|
caption (``str``, *optional*):
|
||||||
Caption of the animation to be sent, 0-200 characters
|
Caption of the animation to be sent, 0-200 characters
|
||||||
|
|
||||||
@@ -48,6 +54,7 @@ class InputMediaAnimation(InputMedia):
|
|||||||
|
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
media: str,
|
media: str,
|
||||||
|
thumb: str = None,
|
||||||
caption: str = "",
|
caption: str = "",
|
||||||
parse_mode: str = "",
|
parse_mode: str = "",
|
||||||
width: int = 0,
|
width: int = 0,
|
||||||
@@ -55,6 +62,7 @@ class InputMediaAnimation(InputMedia):
|
|||||||
duration: int = 0):
|
duration: int = 0):
|
||||||
super().__init__(media, caption, parse_mode)
|
super().__init__(media, caption, parse_mode)
|
||||||
|
|
||||||
|
self.thumb = thumb
|
||||||
self.width = width
|
self.width = width
|
||||||
self.height = height
|
self.height = height
|
||||||
self.duration = duration
|
self.duration = duration
|
||||||
|
@@ -29,6 +29,12 @@ class InputMediaAudio(InputMedia):
|
|||||||
Pass a file_id as string to send an audio that exists on the Telegram servers or
|
Pass a file_id as string to send an audio that exists on the Telegram servers or
|
||||||
pass a file path as string to upload a new audio that exists on your local machine.
|
pass a file path as string to upload a new audio that exists on your local machine.
|
||||||
|
|
||||||
|
thumb (``str``, *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 90 pixels.
|
||||||
|
Thumbnails can't be reused and can be only uploaded as a new file.
|
||||||
|
|
||||||
caption (``str``, *optional*):
|
caption (``str``, *optional*):
|
||||||
Caption of the audio to be sent, 0-200 characters
|
Caption of the audio to be sent, 0-200 characters
|
||||||
|
|
||||||
@@ -49,6 +55,7 @@ class InputMediaAudio(InputMedia):
|
|||||||
|
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
media: str,
|
media: str,
|
||||||
|
thumb: str = None,
|
||||||
caption: str = "",
|
caption: str = "",
|
||||||
parse_mode: str = "",
|
parse_mode: str = "",
|
||||||
duration: int = 0,
|
duration: int = 0,
|
||||||
@@ -56,6 +63,7 @@ class InputMediaAudio(InputMedia):
|
|||||||
title: str = ""):
|
title: str = ""):
|
||||||
super().__init__(media, caption, parse_mode)
|
super().__init__(media, caption, parse_mode)
|
||||||
|
|
||||||
|
self.thumb = thumb
|
||||||
self.duration = duration
|
self.duration = duration
|
||||||
self.performer = performer
|
self.performer = performer
|
||||||
self.title = title
|
self.title = title
|
||||||
|
@@ -28,6 +28,12 @@ class InputMediaDocument(InputMedia):
|
|||||||
Pass a file_id as string to send a file that exists on the Telegram servers or
|
Pass a file_id as string to send a file that exists on the Telegram servers or
|
||||||
pass a file path as string to upload a new file that exists on your local machine.
|
pass a file path as string to upload a new file that exists on your local machine.
|
||||||
|
|
||||||
|
thumb (``str``):
|
||||||
|
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 90 pixels.
|
||||||
|
Thumbnails can't be reused and can be only uploaded as a new file.
|
||||||
|
|
||||||
caption (``str``, *optional*):
|
caption (``str``, *optional*):
|
||||||
Caption of the document to be sent, 0-200 characters
|
Caption of the document to be sent, 0-200 characters
|
||||||
|
|
||||||
@@ -39,6 +45,9 @@ class InputMediaDocument(InputMedia):
|
|||||||
|
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
media: str,
|
media: str,
|
||||||
|
thumb: str = None,
|
||||||
caption: str = "",
|
caption: str = "",
|
||||||
parse_mode: str = ""):
|
parse_mode: str = ""):
|
||||||
super().__init__(media, caption, parse_mode)
|
super().__init__(media, caption, parse_mode)
|
||||||
|
|
||||||
|
self.thumb = thumb
|
||||||
|
@@ -30,6 +30,12 @@ class InputMediaVideo(InputMedia):
|
|||||||
pass a file path as string to upload a new video that exists on your local machine.
|
pass a file path as string to upload a new video that exists on your local machine.
|
||||||
Sending video by a URL is currently unsupported.
|
Sending video by a URL is currently unsupported.
|
||||||
|
|
||||||
|
thumb (``str``):
|
||||||
|
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 90 pixels.
|
||||||
|
Thumbnails can't be reused and can be only uploaded as a new file.
|
||||||
|
|
||||||
caption (``str``, *optional*):
|
caption (``str``, *optional*):
|
||||||
Caption of the video to be sent, 0-200 characters
|
Caption of the video to be sent, 0-200 characters
|
||||||
|
|
||||||
@@ -53,6 +59,7 @@ class InputMediaVideo(InputMedia):
|
|||||||
|
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
media: str,
|
media: str,
|
||||||
|
thumb: str = None,
|
||||||
caption: str = "",
|
caption: str = "",
|
||||||
parse_mode: str = "",
|
parse_mode: str = "",
|
||||||
width: int = 0,
|
width: int = 0,
|
||||||
@@ -61,6 +68,7 @@ class InputMediaVideo(InputMedia):
|
|||||||
supports_streaming: bool = True):
|
supports_streaming: bool = True):
|
||||||
super().__init__(media, caption, parse_mode)
|
super().__init__(media, caption, parse_mode)
|
||||||
|
|
||||||
|
self.thumb = thumb
|
||||||
self.width = width
|
self.width = width
|
||||||
self.height = height
|
self.height = height
|
||||||
self.duration = duration
|
self.duration = duration
|
||||||
|
Reference in New Issue
Block a user