From 5108b78ef5823e76ca96edcf1c30fa0c1ab08bc6 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 24 Apr 2022 11:56:07 +0200 Subject: [PATCH] Add missing fields to InlineQueryResultPhoto --- .../inline_mode/inline_query_result_photo.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pyrogram/types/inline_mode/inline_query_result_photo.py b/pyrogram/types/inline_mode/inline_query_result_photo.py index 110b6046..9e035489 100644 --- a/pyrogram/types/inline_mode/inline_query_result_photo.py +++ b/pyrogram/types/inline_mode/inline_query_result_photo.py @@ -39,6 +39,12 @@ class InlineQueryResultPhoto(InlineQueryResult): URL of the thumbnail for the photo. Defaults to the value passed in *photo_url*. + photo_width (``int``, *optional*): + Width of the photo. + + photo_height (``int``, *optional*): + Height of the photo + id (``str``, *optional*): Unique identifier for this result, 1-64 bytes. Defaults to a randomly generated UUID4. @@ -70,6 +76,8 @@ class InlineQueryResultPhoto(InlineQueryResult): self, photo_url: str, thumb_url: str = None, + photo_width: int = 0, + photo_height: int = 0, id: str = None, title: str = None, description: str = None, @@ -83,6 +91,8 @@ class InlineQueryResultPhoto(InlineQueryResult): self.photo_url = photo_url self.thumb_url = thumb_url + self.photo_width = photo_width + self.photo_height = photo_height self.title = title self.description = description self.caption = caption @@ -96,7 +106,12 @@ class InlineQueryResultPhoto(InlineQueryResult): url=self.photo_url, size=0, mime_type="image/jpeg", - attributes=[] + attributes=[ + raw.types.DocumentAttributeImageSize( + w=self.photo_width, + h=self.photo_height + ) + ] ) if self.thumb_url is None: