From c37dcb07cf7ef125ac38d08b16a2d57ab1c98802 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 15 Oct 2018 10:50:17 +0200 Subject: [PATCH] Add parse_inline_query util method --- compiler/api/compiler.py | 1 + pyrogram/client/ext/utils.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/compiler/api/compiler.py b/compiler/api/compiler.py index bcb96ea4..67c66c18 100644 --- a/compiler/api/compiler.py +++ b/compiler/api/compiler.py @@ -506,6 +506,7 @@ def start(): f.write("\n 0xb0700028: \"pyrogram.client.types.Dialog\",") f.write("\n 0xb0700029: \"pyrogram.client.types.Dialogs\",") f.write("\n 0xb0700030: \"pyrogram.client.types.ChatMembers\",") + f.write("\n 0xb0700032: \"pyrogram.client.types.InlineQuery\"") f.write("\n}\n") diff --git a/pyrogram/client/ext/utils.py b/pyrogram/client/ext/utils.py index a497e3c9..925ca0a8 100644 --- a/pyrogram/client/ext/utils.py +++ b/pyrogram/client/ext/utils.py @@ -889,6 +889,20 @@ def parse_inline_callback_query(client, callback_query, users): ) +def parse_inline_query(client, inline_query: types.UpdateBotInlineQuery, users): + return pyrogram_types.InlineQuery( + client=client, + id=str(inline_query.query_id), + from_user=parse_user(users[inline_query.user_id]), + query=inline_query.query, + offset=inline_query.offset, + location=pyrogram_types.Location( + longitude=inline_query.geo.long, + latitude=inline_query.geo.lat + ) if inline_query.geo else None + ) + + def parse_chat_full( client, chat_full: types.messages.ChatFull or types.UserFull