Ignore ChannelParticipantLeft during iter_participants

Closes #3231.
This commit is contained in:
Lonami Exo 2022-09-20 18:12:29 +02:00
parent 2d4305db76
commit ff0f9b0e8f

View File

@ -155,7 +155,10 @@ class _ParticipantsIter(RequestIter):
users = {user.id: user for user in full.users}
for participant in full.full_chat.participants.participants:
if isinstance(participant, types.ChannelParticipantBanned):
if isinstance(participant, types.ChannelParticipantLeft):
# See issue #3231 to learn why this is ignored.
continue
elif isinstance(participant, types.ChannelParticipantBanned):
user_id = participant.peer.user_id
else:
user_id = participant.user_id