2019-05-03 22:37:27 +03:00
|
|
|
import typing
|
|
|
|
|
2021-09-12 17:58:06 +03:00
|
|
|
from ..types import _custom
|
2021-09-26 20:58:42 +03:00
|
|
|
from .._misc import hints
|
|
|
|
from .. import _tl
|
2018-08-01 02:06:47 +03:00
|
|
|
|
2019-05-03 22:37:27 +03:00
|
|
|
if typing.TYPE_CHECKING:
|
|
|
|
from .telegramclient import TelegramClient
|
|
|
|
|
2018-08-01 02:06:47 +03:00
|
|
|
|
2021-09-11 14:33:27 +03:00
|
|
|
async def inline_query(
|
|
|
|
self: 'TelegramClient',
|
2022-03-02 14:38:59 +03:00
|
|
|
bot: 'hints.DialogLike',
|
2021-09-11 14:33:27 +03:00
|
|
|
query: str,
|
|
|
|
*,
|
2022-03-02 14:38:59 +03:00
|
|
|
dialog: 'hints.DialogLike' = None,
|
2021-09-11 14:33:27 +03:00
|
|
|
offset: str = None,
|
2021-09-12 17:58:06 +03:00
|
|
|
geo_point: '_tl.GeoPoint' = None) -> _custom.InlineResults:
|
2021-09-11 14:33:27 +03:00
|
|
|
bot = await self.get_input_entity(bot)
|
2022-03-02 11:00:39 +03:00
|
|
|
if dialog:
|
|
|
|
peer = await self.get_input_entity(dialog)
|
2021-09-11 14:33:27 +03:00
|
|
|
else:
|
2021-09-12 13:16:02 +03:00
|
|
|
peer = _tl.InputPeerEmpty()
|
2021-09-11 14:33:27 +03:00
|
|
|
|
2021-09-12 13:16:02 +03:00
|
|
|
result = await self(_tl.fn.messages.GetInlineBotResults(
|
2021-09-11 14:33:27 +03:00
|
|
|
bot=bot,
|
|
|
|
peer=peer,
|
|
|
|
query=query,
|
|
|
|
offset=offset or '',
|
|
|
|
geo_point=geo_point
|
|
|
|
))
|
|
|
|
|
2022-03-02 11:00:39 +03:00
|
|
|
return _custom.InlineResults(self, result, entity=peer if dialog else None)
|