mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-18 19:16:43 +00:00
Fix some chat IDs start with 1000
This commit is contained in:
parent
129f5bf1f8
commit
b667bb0c1a
@ -552,8 +552,13 @@ def resolve_id(marked_id):
|
|||||||
if marked_id >= 0:
|
if marked_id >= 0:
|
||||||
return marked_id, PeerUser
|
return marked_id, PeerUser
|
||||||
|
|
||||||
if str(marked_id).startswith('-100'):
|
# There have been report of chat IDs being 10000xyz, which means their
|
||||||
return int(str(marked_id)[4:]), PeerChannel
|
# marked version is -10000xyz, which in turn looks like a channel but
|
||||||
|
# it becomes 00xyz (= xyz). Hence, we must assert that there are only
|
||||||
|
# two zeroes.
|
||||||
|
m = re.match(r'-100([^0]\d*)', str(marked_id))
|
||||||
|
if m:
|
||||||
|
return int(m.group(1)), PeerChannel
|
||||||
|
|
||||||
return -marked_id, PeerChat
|
return -marked_id, PeerChat
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user