Handle non-user bans when iterating banned participants

Closes #3105.
This commit is contained in:
Lonami Exo 2021-08-22 13:24:02 +02:00
parent bc6bcd31ad
commit 9285e50c63

View File

@ -233,6 +233,9 @@ class _ParticipantsIter(RequestIter):
for participant in participants.participants:
if isinstance(participant, types.ChannelParticipantBanned):
if not isinstance(participant.peer, types.PeerUser):
# May have the entire channel banned. See #3105.
continue
user_id = participant.peer.user_id
else:
user_id = participant.user_id