From d9aa2a3ab0fc1c0ac312b0300d3a2520fd921a1a Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Fri, 13 Apr 2018 15:40:35 +0200 Subject: [PATCH] Fix channels ids --- pyrogram/client/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrogram/client/utils.py b/pyrogram/client/utils.py index f4f9a505..6e2c6b1b 100644 --- a/pyrogram/client/utils.py +++ b/pyrogram/client/utils.py @@ -12,6 +12,6 @@ def get_peer_id(input_peer) -> int: def get_input_peer(peer_id: int, access_hash: int = 0): return ( 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) )