From d398b5b29c3a77114b2bd69fd15599a0ccb74270 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 12 Mar 2023 17:52:03 +0100 Subject: [PATCH] Separate cases between Channel and ChannelForbidden Signed-off-by: wulan17 --- pyrogram/client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyrogram/client.py b/pyrogram/client.py index 8140327b..3e3fbbf0 100644 --- a/pyrogram/client.py +++ b/pyrogram/client.py @@ -475,7 +475,7 @@ class Client(Methods): peer_id = -peer.id access_hash = 0 peer_type = "group" - elif isinstance(peer, (raw.types.Channel, raw.types.ChannelForbidden)): + elif isinstance(peer, raw.types.Channel): peer_id = utils.get_channel_id(peer.id) access_hash = peer.access_hash username = ( @@ -484,6 +484,10 @@ class Client(Methods): else None ) peer_type = "channel" if peer.broadcast else "supergroup" + elif isinstance(peer, raw.types.ChannelForbidden): + peer_id = utils.get_channel_id(peer.id) + access_hash = peer.access_hash + peer_type = "channel" if peer.broadcast else "supergroup" else: continue