From ac318831dc0feb6151e63da1bf2ff28ed8ed036a Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Fri, 22 Mar 2019 13:47:31 +0100 Subject: [PATCH] Add missing awaits --- pyrogram/client/ext/base_client.py | 2 +- pyrogram/client/methods/bots/answer_inline_query.py | 4 ++-- pyrogram/client/types/inline_mode/inline_query.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyrogram/client/ext/base_client.py b/pyrogram/client/ext/base_client.py index 1e10a7b3..34328589 100644 --- a/pyrogram/client/ext/base_client.py +++ b/pyrogram/client/ext/base_client.py @@ -129,5 +129,5 @@ class BaseClient: async def get_chat_members_count(self, *args, **kwargs): pass - def answer_inline_query(self, *args, **kwargs): + async def answer_inline_query(self, *args, **kwargs): pass diff --git a/pyrogram/client/methods/bots/answer_inline_query.py b/pyrogram/client/methods/bots/answer_inline_query.py index 7b3524b2..65f2ff3a 100644 --- a/pyrogram/client/methods/bots/answer_inline_query.py +++ b/pyrogram/client/methods/bots/answer_inline_query.py @@ -24,7 +24,7 @@ from ...types.inline_mode import InlineQueryResult class AnswerInlineQuery(BaseClient): - def answer_inline_query( + async def answer_inline_query( self, inline_query_id: str, results: List[InlineQueryResult], @@ -75,7 +75,7 @@ class AnswerInlineQuery(BaseClient): Returns: On success, True is returned. """ - return self.send( + return await self.send( functions.messages.SetInlineBotResults( query_id=int(inline_query_id), results=[r.write() for r in results], diff --git a/pyrogram/client/types/inline_mode/inline_query.py b/pyrogram/client/types/inline_mode/inline_query.py index 9c1c02ac..737960ca 100644 --- a/pyrogram/client/types/inline_mode/inline_query.py +++ b/pyrogram/client/types/inline_mode/inline_query.py @@ -83,7 +83,7 @@ class InlineQuery(PyrogramType, Update): client=client ) - def answer( + async def answer( self, results: List[InlineQueryResult], cache_time: int = 300, @@ -141,7 +141,7 @@ class InlineQuery(PyrogramType, Update): where they wanted to use the bot's inline capabilities. """ - return self._client.answer_inline_query( + return await self._client.answer_inline_query( inline_query_id=self.id, results=results, cache_time=cache_time,