mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
Add missing fields to InlineQueryResultPhoto
This commit is contained in:
parent
077687b85d
commit
5108b78ef5
@ -39,6 +39,12 @@ class InlineQueryResultPhoto(InlineQueryResult):
|
|||||||
URL of the thumbnail for the photo.
|
URL of the thumbnail for the photo.
|
||||||
Defaults to the value passed in *photo_url*.
|
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*):
|
id (``str``, *optional*):
|
||||||
Unique identifier for this result, 1-64 bytes.
|
Unique identifier for this result, 1-64 bytes.
|
||||||
Defaults to a randomly generated UUID4.
|
Defaults to a randomly generated UUID4.
|
||||||
@ -70,6 +76,8 @@ class InlineQueryResultPhoto(InlineQueryResult):
|
|||||||
self,
|
self,
|
||||||
photo_url: str,
|
photo_url: str,
|
||||||
thumb_url: str = None,
|
thumb_url: str = None,
|
||||||
|
photo_width: int = 0,
|
||||||
|
photo_height: int = 0,
|
||||||
id: str = None,
|
id: str = None,
|
||||||
title: str = None,
|
title: str = None,
|
||||||
description: str = None,
|
description: str = None,
|
||||||
@ -83,6 +91,8 @@ class InlineQueryResultPhoto(InlineQueryResult):
|
|||||||
|
|
||||||
self.photo_url = photo_url
|
self.photo_url = photo_url
|
||||||
self.thumb_url = thumb_url
|
self.thumb_url = thumb_url
|
||||||
|
self.photo_width = photo_width
|
||||||
|
self.photo_height = photo_height
|
||||||
self.title = title
|
self.title = title
|
||||||
self.description = description
|
self.description = description
|
||||||
self.caption = caption
|
self.caption = caption
|
||||||
@ -96,7 +106,12 @@ class InlineQueryResultPhoto(InlineQueryResult):
|
|||||||
url=self.photo_url,
|
url=self.photo_url,
|
||||||
size=0,
|
size=0,
|
||||||
mime_type="image/jpeg",
|
mime_type="image/jpeg",
|
||||||
attributes=[]
|
attributes=[
|
||||||
|
raw.types.DocumentAttributeImageSize(
|
||||||
|
w=self.photo_width,
|
||||||
|
h=self.photo_height
|
||||||
|
)
|
||||||
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.thumb_url is None:
|
if self.thumb_url is None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user