Skip to content

Commit 0a90d54

Browse files
committed
Separate cases between Channel and ChannelForbidden
1 parent fb3f9ac commit 0a90d54

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pyrogram/client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ async def fetch_peers(self, peers: List[Union[raw.types.User, raw.types.Chat, ra
510510
peer_id = -peer.id
511511
access_hash = 0
512512
peer_type = "group"
513-
elif isinstance(peer, (raw.types.Channel, raw.types.ChannelForbidden)):
513+
elif isinstance(peer, raw.types.Channel):
514514
peer_id = utils.get_channel_id(peer.id)
515515
access_hash = peer.access_hash
516516
username = (
@@ -519,6 +519,10 @@ async def fetch_peers(self, peers: List[Union[raw.types.User, raw.types.Chat, ra
519519
else None
520520
)
521521
peer_type = "channel" if peer.broadcast else "supergroup"
522+
elif isinstance(peer, raw.types.ChannelForbidden):
523+
peer_id = utils.get_channel_id(peer.id)
524+
access_hash = peer.access_hash
525+
peer_type = "channel" if peer.broadcast else "supergroup"
522526
else:
523527
continue
524528

0 commit comments

Comments
 (0)