mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +00:00
Add missing fields to InlineQueryResultArticle
This commit is contained in:
parent
109c9d4a0a
commit
077687b85d
@ -43,11 +43,17 @@ class InlineQueryResultArticle(InlineQueryResult):
|
|||||||
description (``str``, *optional*):
|
description (``str``, *optional*):
|
||||||
Short description of the result.
|
Short description of the result.
|
||||||
|
|
||||||
thumb_url (``str``, *optional*):
|
|
||||||
URL of the thumbnail for the result.
|
|
||||||
|
|
||||||
reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup`, *optional*):
|
reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup`, *optional*):
|
||||||
Inline keyboard attached to the message.
|
Inline keyboard attached to the message.
|
||||||
|
|
||||||
|
thumb_url (``str``, *optional*):
|
||||||
|
Url of the thumbnail for the result.
|
||||||
|
|
||||||
|
thumb_width (``int``, *optional*):
|
||||||
|
Thumbnail width.
|
||||||
|
|
||||||
|
thumb_height (``int``, *optional*):
|
||||||
|
Thumbnail height
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
@ -55,10 +61,12 @@ class InlineQueryResultArticle(InlineQueryResult):
|
|||||||
title: str,
|
title: str,
|
||||||
input_message_content: "types.InputMessageContent",
|
input_message_content: "types.InputMessageContent",
|
||||||
id: str = None,
|
id: str = None,
|
||||||
reply_markup: "types.InlineKeyboardMarkup" = None,
|
|
||||||
url: str = None,
|
url: str = None,
|
||||||
description: str = None,
|
description: str = None,
|
||||||
thumb_url: str = None
|
reply_markup: "types.InlineKeyboardMarkup" = None,
|
||||||
|
thumb_url: str = None,
|
||||||
|
thumb_width: int = 0,
|
||||||
|
thumb_height: int = 0
|
||||||
):
|
):
|
||||||
super().__init__("article", id, input_message_content, reply_markup)
|
super().__init__("article", id, input_message_content, reply_markup)
|
||||||
|
|
||||||
@ -66,6 +74,8 @@ class InlineQueryResultArticle(InlineQueryResult):
|
|||||||
self.url = url
|
self.url = url
|
||||||
self.description = description
|
self.description = description
|
||||||
self.thumb_url = thumb_url
|
self.thumb_url = thumb_url
|
||||||
|
self.thumb_width = thumb_width
|
||||||
|
self.thumb_height = thumb_height
|
||||||
|
|
||||||
async def write(self, client: "pyrogram.Client"):
|
async def write(self, client: "pyrogram.Client"):
|
||||||
return raw.types.InputBotInlineResult(
|
return raw.types.InputBotInlineResult(
|
||||||
@ -79,6 +89,11 @@ class InlineQueryResultArticle(InlineQueryResult):
|
|||||||
url=self.thumb_url,
|
url=self.thumb_url,
|
||||||
size=0,
|
size=0,
|
||||||
mime_type="image/jpeg",
|
mime_type="image/jpeg",
|
||||||
attributes=[]
|
attributes=[
|
||||||
|
raw.types.DocumentAttributeImageSize(
|
||||||
|
w=self.thumb_width,
|
||||||
|
h=self.thumb_height
|
||||||
|
)
|
||||||
|
]
|
||||||
) if self.thumb_url else None
|
) if self.thumb_url else None
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user