Add method to resolve inline message IDs

This commit is contained in:
udf 2018-09-19 13:19:03 +02:00
parent 497c2144f2
commit f2f5409dcb
No known key found for this signature in database
GPG Key ID: E40724BAD73AF77B

View File

@ -936,6 +936,22 @@ def resolve_invite_link(link):
return None, None, None 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('<iiiq', _decode_telegram_base64(inline_msg_id))
except (struct.error, TypeError):
return None, None, None, None
def get_appropriated_part_size(file_size): def get_appropriated_part_size(file_size):
""" """
Gets the appropriated part size when uploading or downloading files, Gets the appropriated part size when uploading or downloading files,