mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Add support for Bot API channel/supergroup IDs starting with -100
This commit is contained in:
parent
b1f11b7a97
commit
38fb4b8d2a
@ -524,6 +524,7 @@ class Client:
|
||||
peer_id,
|
||||
peer_access_hash
|
||||
)
|
||||
peer_id = int("-100" + str(peer_id))
|
||||
else:
|
||||
continue
|
||||
|
||||
@ -553,7 +554,7 @@ class Client:
|
||||
channel_id=resolved_peer.chats[0].id,
|
||||
access_hash=resolved_peer.chats[0].access_hash
|
||||
)
|
||||
chat_id = input_peer.channel_id
|
||||
chat_id = int("-100" + str(input_peer.channel_id))
|
||||
else:
|
||||
raise PeerIdInvalid
|
||||
|
||||
@ -576,6 +577,9 @@ class Client:
|
||||
else:
|
||||
try:
|
||||
return self.peers_by_id[chat_id]
|
||||
except KeyError:
|
||||
try:
|
||||
return self.peers_by_id[int("-100" + str(chat_id))]
|
||||
except KeyError:
|
||||
raise PeerIdInvalid
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user