Skip to content

Commit 077687b

Browse files
committed
Add missing fields to InlineQueryResultArticle
1 parent 109c9d4 commit 077687b

1 file changed

Lines changed: 21 additions & 6 deletions

File tree

pyrogram/types/inline_mode/inline_query_result_article.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,29 +43,39 @@ class InlineQueryResultArticle(InlineQueryResult):
4343
description (``str``, *optional*):
4444
Short description of the result.
4545
46-
thumb_url (``str``, *optional*):
47-
URL of the thumbnail for the result.
48-
4946
reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup`, *optional*):
5047
Inline keyboard attached to the message.
48+
49+
thumb_url (``str``, *optional*):
50+
Url of the thumbnail for the result.
51+
52+
thumb_width (``int``, *optional*):
53+
Thumbnail width.
54+
55+
thumb_height (``int``, *optional*):
56+
Thumbnail height
5157
"""
5258

5359
def __init__(
5460
self,
5561
title: str,
5662
input_message_content: "types.InputMessageContent",
5763
id: str = None,
58-
reply_markup: "types.InlineKeyboardMarkup" = None,
5964
url: str = None,
6065
description: str = None,
61-
thumb_url: str = None
66+
reply_markup: "types.InlineKeyboardMarkup" = None,
67+
thumb_url: str = None,
68+
thumb_width: int = 0,
69+
thumb_height: int = 0
6270
):
6371
super().__init__("article", id, input_message_content, reply_markup)
6472

6573
self.title = title
6674
self.url = url
6775
self.description = description
6876
self.thumb_url = thumb_url
77+
self.thumb_width = thumb_width
78+
self.thumb_height = thumb_height
6979

7080
async def write(self, client: "pyrogram.Client"):
7181
return raw.types.InputBotInlineResult(
@@ -79,6 +89,11 @@ async def write(self, client: "pyrogram.Client"):
7989
url=self.thumb_url,
8090
size=0,
8191
mime_type="image/jpeg",
82-
attributes=[]
92+
attributes=[
93+
raw.types.DocumentAttributeImageSize(
94+
w=self.thumb_width,
95+
h=self.thumb_height
96+
)
97+
]
8398
) if self.thumb_url else None
8499
)

0 commit comments

Comments
 (0)