Skip to content

Commit 7cabedc

Browse files
committed
allow to specify chat_id in get_inline_bot_results
Closes #212
1 parent 3a1b48d commit 7cabedc

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pyrogram/methods/bots/get_inline_bot_results.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ async def get_inline_bot_results(
3030
query: str = "",
3131
offset: str = "",
3232
latitude: float = None,
33-
longitude: float = None
33+
longitude: float = None,
34+
# TODO: fix inconsistency
35+
chat_id: Union[int, str] = None,
3436
):
3537
"""Get bot results via inline queries.
3638
You can then send a result using :meth:`~pyrogram.Client.send_inline_bot_result`
@@ -57,6 +59,11 @@ async def get_inline_bot_results(
5759
Longitude of the location.
5860
Useful for location-based results only.
5961
62+
chat_id (``int`` | ``str``):
63+
Unique identifier (int) or username (str) of the target chat.
64+
For your personal cloud (Saved Messages) you can simply use "me" or "self".
65+
For a contact that exists in your Telegram address book you can use his phone number (str).
66+
6067
Returns:
6168
:obj:`BotResults <pyrogram.api.types.messages.BotResults>`: On Success.
6269
@@ -75,7 +82,7 @@ async def get_inline_bot_results(
7582
return await self.invoke(
7683
raw.functions.messages.GetInlineBotResults(
7784
bot=await self.resolve_peer(bot),
78-
peer=raw.types.InputPeerSelf(),
85+
peer=await self.resolve_peer(chat_id) if chat_id else raw.types.InputPeerSelf(),
7986
query=query,
8087
offset=offset,
8188
geo_point=raw.types.InputGeoPoint(

0 commit comments

Comments
 (0)