mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-09 05:19:41 +00:00
Raise TimeoutError from inline_query instead
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import typing
|
||||
import asyncio
|
||||
|
||||
from ..types import _custom
|
||||
from .._misc import hints
|
||||
from .. import _tl
|
||||
from .. import errors, _tl
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
from .telegramclient import TelegramClient
|
||||
@@ -22,12 +23,15 @@ async def inline_query(
|
||||
else:
|
||||
peer = _tl.InputPeerEmpty()
|
||||
|
||||
result = await self(_tl.fn.messages.GetInlineBotResults(
|
||||
bot=bot,
|
||||
peer=peer,
|
||||
query=query,
|
||||
offset=offset or '',
|
||||
geo_point=geo_point
|
||||
))
|
||||
try:
|
||||
result = await self(_tl.fn.messages.GetInlineBotResults(
|
||||
bot=bot,
|
||||
peer=peer,
|
||||
query=query,
|
||||
offset=offset or '',
|
||||
geo_point=geo_point
|
||||
))
|
||||
except errors.BotResponseTimeoutError:
|
||||
raise asyncio.TimeoutError from None
|
||||
|
||||
return _custom.InlineResults(self, result, entity=peer if dialog else None)
|
||||
|
Reference in New Issue
Block a user