Skip to content

Commit 5108b78

Browse files
committed
Add missing fields to InlineQueryResultPhoto
1 parent 077687b commit 5108b78

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

pyrogram/types/inline_mode/inline_query_result_photo.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ class InlineQueryResultPhoto(InlineQueryResult):
3939
URL of the thumbnail for the photo.
4040
Defaults to the value passed in *photo_url*.
4141
42+
photo_width (``int``, *optional*):
43+
Width of the photo.
44+
45+
photo_height (``int``, *optional*):
46+
Height of the photo
47+
4248
id (``str``, *optional*):
4349
Unique identifier for this result, 1-64 bytes.
4450
Defaults to a randomly generated UUID4.
@@ -70,6 +76,8 @@ def __init__(
7076
self,
7177
photo_url: str,
7278
thumb_url: str = None,
79+
photo_width: int = 0,
80+
photo_height: int = 0,
7381
id: str = None,
7482
title: str = None,
7583
description: str = None,
@@ -83,6 +91,8 @@ def __init__(
8391

8492
self.photo_url = photo_url
8593
self.thumb_url = thumb_url
94+
self.photo_width = photo_width
95+
self.photo_height = photo_height
8696
self.title = title
8797
self.description = description
8898
self.caption = caption
@@ -96,7 +106,12 @@ async def write(self, client: "pyrogram.Client"):
96106
url=self.photo_url,
97107
size=0,
98108
mime_type="image/jpeg",
99-
attributes=[]
109+
attributes=[
110+
raw.types.DocumentAttributeImageSize(
111+
w=self.photo_width,
112+
h=self.photo_height
113+
)
114+
]
100115
)
101116

102117
if self.thumb_url is None:

0 commit comments

Comments
 (0)