mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-17 05:08:02 +00:00
Fix channels ids
This commit is contained in:
parent
9631dc7780
commit
d9aa2a3ab0
@ -12,6 +12,6 @@ def get_peer_id(input_peer) -> int:
|
|||||||
def get_input_peer(peer_id: int, access_hash: int = 0):
|
def get_input_peer(peer_id: int, access_hash: int = 0):
|
||||||
return (
|
return (
|
||||||
types.InputPeerUser(peer_id, access_hash) if peer_id > 0
|
types.InputPeerUser(peer_id, access_hash) if peer_id > 0
|
||||||
else types.InputPeerChannel(int(str(peer_id).lstrip("-100")), access_hash) if str(peer_id).startswith("-100")
|
else types.InputPeerChannel(int(str(peer_id)[4:]), access_hash) if str(peer_id).startswith("-100")
|
||||||
else types.InputPeerChat(-peer_id)
|
else types.InputPeerChat(-peer_id)
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user