diff --git a/telethon/utils.py b/telethon/utils.py index 9ca5a5a5..c4009670 100644 --- a/telethon/utils.py +++ b/telethon/utils.py @@ -936,6 +936,27 @@ 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 + ``(message id, peer, dc id, access hash)`` + + The ``peer`` may either be a :tl:`PeerUser` referencing + the user who sent the message via the bot in a private + conversation or small group chat, or a :tl:`PeerChannel` + if the message was sent in a channel. + + The ``access_hash`` does not have any use yet. + """ + try: + dc_id, message_id, pid, access_hash = \ + struct.unpack('