diff --git a/pyrogram/client/dispatcher/dispatcher.py b/pyrogram/client/dispatcher/dispatcher.py index ea10a201..5506cbdd 100644 --- a/pyrogram/client/dispatcher/dispatcher.py +++ b/pyrogram/client/dispatcher/dispatcher.py @@ -205,7 +205,7 @@ class Dispatcher: self.dispatch( pyrogram.Update( callback_query=utils.parse_inline_callback_query( - update, users + self.client, update, users ) ) ) diff --git a/pyrogram/client/ext/utils.py b/pyrogram/client/ext/utils.py index b98a05a8..a497e3c9 100644 --- a/pyrogram/client/ext/utils.py +++ b/pyrogram/client/ext/utils.py @@ -865,11 +865,12 @@ def parse_callback_query(client, callback_query, users): message=client.get_messages(peer_id, callback_query.msg_id), chat_instance=str(callback_query.chat_instance), data=callback_query.data.decode(), - game_short_name=callback_query.game_short_name + game_short_name=callback_query.game_short_name, + client=client ) -def parse_inline_callback_query(callback_query, users): +def parse_inline_callback_query(client, callback_query, users): return pyrogram_types.CallbackQuery( id=str(callback_query.query_id), from_user=parse_user(users[callback_query.user_id]), @@ -883,7 +884,8 @@ def parse_inline_callback_query(callback_query, users): ), b"-_" ).decode().rstrip("="), - game_short_name=callback_query.game_short_name + game_short_name=callback_query.game_short_name, + client=client ) diff --git a/pyrogram/client/types/bots/callback_query.py b/pyrogram/client/types/bots/callback_query.py index 63228f33..76f463ad 100644 --- a/pyrogram/client/types/bots/callback_query.py +++ b/pyrogram/client/types/bots/callback_query.py @@ -57,11 +57,13 @@ class CallbackQuery(Object): id: str, from_user, chat_instance: str, + client=None, message=None, inline_message_id: str = None, data: str = None, game_short_name: str = None ): + self._client = client self.id = id # string self.from_user = from_user # User self.message = message # flags.0?Message