From f2f5409dcbedbc6ce50e5d2a04cf6f43123bb21d Mon Sep 17 00:00:00 2001 From: udf Date: Wed, 19 Sep 2018 13:19:03 +0200 Subject: [PATCH] Add method to resolve inline message IDs --- telethon/utils.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/telethon/utils.py b/telethon/utils.py index 9ca5a5a5..9fa12791 100644 --- a/telethon/utils.py +++ b/telethon/utils.py @@ -936,6 +936,22 @@ def resolve_invite_link(link): return None, None, None +def resolve_inline_message_id(inline_msg_id): + """ + Resolves an inline message ID. Returns a tuple of + ``(dc id, message id, group id, access hash)`` + + Note that ``group_id`` is negated if the message originated from a channel + otherwise it's the (positive) ID of the sender + + The ``access_hash`` isn't particularly useful, but it's unpacked nevertheless + """ + try: + return struct.unpack('