Add parse_inline_query util method

This commit is contained in:
Dan 2018-10-15 10:50:17 +02:00
parent a9fe0fffc6
commit c37dcb07cf
2 changed files with 15 additions and 0 deletions

View File

@ -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")

View File

@ -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