mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 01:16:35 +03:00
Fix peer ID check to work with higher IDs
This commit is taken from
5f4bfe6b9b
This commit is contained in:
parent
9c796e8d73
commit
c9ecd61f7e
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user