mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 20:14:51 +00:00
Pyrofork: Add description and thumb to InlineQueryResultAudio #40
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
44415e7013
commit
c0779b52ff
1 changed files with 18 additions and 1 deletions
|
|
@ -56,12 +56,18 @@ class InlineQueryResultAudio(InlineQueryResult):
|
|||
|
||||
caption_entities (List of :obj:`~pyrogram.types.MessageEntity`):
|
||||
List of special entities that appear in the caption, which can be specified instead of *parse_mode*.
|
||||
|
||||
description (``str``, *optional*):
|
||||
Short description of the result.
|
||||
|
||||
reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup`, *optional*):
|
||||
Inline keyboard attached to the message.
|
||||
|
||||
input_message_content (:obj:`~pyrogram.types.InputMessageContent`, *optional*):
|
||||
Content of the message to be sent instead of the audio.
|
||||
|
||||
thumb_url (``str``, *optional*):
|
||||
Url of the thumbnail for the result.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
|
|
@ -74,8 +80,10 @@ class InlineQueryResultAudio(InlineQueryResult):
|
|||
caption: str = "",
|
||||
parse_mode: Optional["enums.ParseMode"] = None,
|
||||
caption_entities: List["types.MessageEntity"] = None,
|
||||
description: str = None,
|
||||
reply_markup: "types.InlineKeyboardMarkup" = None,
|
||||
input_message_content: "types.InputMessageContent" = None
|
||||
input_message_content: "types.InputMessageContent" = None,
|
||||
thumb_url: str = None
|
||||
):
|
||||
super().__init__("audio", id, input_message_content, reply_markup)
|
||||
|
||||
|
|
@ -86,6 +94,8 @@ class InlineQueryResultAudio(InlineQueryResult):
|
|||
self.caption = caption
|
||||
self.parse_mode = parse_mode
|
||||
self.caption_entities = caption_entities
|
||||
self.description = description
|
||||
self.thumb_url = thumb_url
|
||||
|
||||
async def write(self, client: "pyrogram.Client"):
|
||||
audio = raw.types.InputWebDocument(
|
||||
|
|
@ -108,6 +118,13 @@ class InlineQueryResultAudio(InlineQueryResult):
|
|||
type=self.type,
|
||||
title=self.title,
|
||||
content=audio,
|
||||
description=self.description,
|
||||
thumb=raw.types.InputWebDocument(
|
||||
url=self.thumb_url,
|
||||
size=0,
|
||||
mime_type="image/jpeg",
|
||||
attributes=[]
|
||||
) if self.thumb_url else None,
|
||||
send_message=(
|
||||
await self.input_message_content.write(client, self.reply_markup)
|
||||
if self.input_message_content
|
||||
|
|
|
|||
Loading…
Reference in a new issue