Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix type hint for InputMediaVideo’s thumb attribute
The thumb attribute can also be a `BinaryIO` as it is [passed](https://github.com/pyrogram/pyrogram/blob/master/pyrogram/methods/messages/send_media_group.py#L165) to a method in a position that can also accept a `BinaryIO`.

Co-authored-by: Davide Galilei <DavideGalilei+43778739@users.noreply.github.com>
  • Loading branch information
rojvv and Davide Galilei authored Apr 26, 2023
commit 7d6cecbdd11322b9b970f08b98a87687e07ceb50
4 changes: 2 additions & 2 deletions pyrogram/types/input_media/input_media_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class InputMediaVideo(InputMedia):
pass a binary file-like object with its attribute “.name” set for in-memory uploads or
pass an HTTP URL as a string for Telegram to get a video from the Internet.

thumb (``str``):
thumb (``str`` | ``BinaryIO``):
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 Expand Up @@ -71,7 +71,7 @@ class InputMediaVideo(InputMedia):
def __init__(
self,
media: Union[str, BinaryIO],
thumb: str = None,
thumb: str | BinaryIO = None,
caption: str = "",
parse_mode: Optional["enums.ParseMode"] = None,
caption_entities: List[MessageEntity] = None,
Expand Down