mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-07 07:24:51 +00:00
pyrofork: Parse send_inline_bot_result result
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
7726e22161
commit
591cd3ac86
1 changed files with 12 additions and 3 deletions
|
|
@ -35,7 +35,7 @@ class SendInlineBotResult:
|
||||||
quote_text: str = None,
|
quote_text: str = None,
|
||||||
quote_entities: List["types.MessageEntity"] = None,
|
quote_entities: List["types.MessageEntity"] = None,
|
||||||
parse_mode: Optional["enums.ParseMode"] = None
|
parse_mode: Optional["enums.ParseMode"] = None
|
||||||
) -> "raw.base.Updates":
|
) -> "types.Message":
|
||||||
"""Send an inline bot result.
|
"""Send an inline bot result.
|
||||||
Bot results can be retrieved using :meth:`~pyrogram.Client.get_inline_bot_results`
|
Bot results can be retrieved using :meth:`~pyrogram.Client.get_inline_bot_results`
|
||||||
|
|
||||||
|
|
@ -79,7 +79,7 @@ class SendInlineBotResult:
|
||||||
For quote_text.
|
For quote_text.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
:obj:`~pyrogram.raw.base.Updates`: Currently, on success, a raw result is returned.
|
:obj:`~pyrogram.types.Message`: On success, the sent message is returned.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
@ -97,7 +97,7 @@ class SendInlineBotResult:
|
||||||
parse_mode=parse_mode
|
parse_mode=parse_mode
|
||||||
)
|
)
|
||||||
|
|
||||||
return await self.invoke(
|
r = await self.invoke(
|
||||||
raw.functions.messages.SendInlineBotResult(
|
raw.functions.messages.SendInlineBotResult(
|
||||||
peer=await self.resolve_peer(chat_id),
|
peer=await self.resolve_peer(chat_id),
|
||||||
query_id=query_id,
|
query_id=query_id,
|
||||||
|
|
@ -107,3 +107,12 @@ class SendInlineBotResult:
|
||||||
reply_to=reply_to
|
reply_to=reply_to
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for i in r.updates:
|
||||||
|
if isinstance(i, (raw.types.UpdateNewMessage,
|
||||||
|
raw.types.UpdateNewChannelMessage)):
|
||||||
|
return await types.Message._parse(
|
||||||
|
self, i.message,
|
||||||
|
{i.id: i for i in r.users},
|
||||||
|
{i.id: i for i in r.chats},
|
||||||
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue