Add new format to resolve invite link (#1670)

This commit is contained in:
painor 2021-01-12 19:50:27 +01:00 committed by GitHub
parent 82d25a7e52
commit c0ed709adf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1289,8 +1289,14 @@ def resolve_invite_link(link):
payload = _decode_telegram_base64(link_hash)
try:
if len(payload) == 12:
return 0, *struct.unpack('>LQ', payload)
elif len(payload) == 16:
return struct.unpack('>LLQ', payload)
else:
pass
except (struct.error, TypeError):
pass
return None, None, None