mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2026-09-08 09:51:57 +00:00
Fix peer ID check to work with higher IDs
This commit is taken from https://github.com/tulir/Telethon/commit/5f4bfe6b9be9da6d7ef0a55c67b7cc1cfd142fe2
This commit is contained in:
+2
-2
@@ -1029,13 +1029,13 @@ def get_peer_id(peer, add_mark=True):
|
||||
return peer.user_id
|
||||
elif isinstance(peer, types.PeerChat):
|
||||
# Check in case the user mixed things up to avoid blowing up
|
||||
if not (0 < peer.chat_id <= 0x7fffffff):
|
||||
if not (0 < peer.chat_id <= 9999999999):
|
||||
peer.chat_id = resolve_id(peer.chat_id)[0]
|
||||
|
||||
return -peer.chat_id if add_mark else peer.chat_id
|
||||
else: # if isinstance(peer, types.PeerChannel):
|
||||
# Check in case the user mixed things up to avoid blowing up
|
||||
if not (0 < peer.channel_id <= 0x7fffffff):
|
||||
if not (0 < peer.channel_id <= 9999999999):
|
||||
peer.channel_id = resolve_id(peer.channel_id)[0]
|
||||
|
||||
if not add_mark:
|
||||
|
||||
Reference in New Issue
Block a user