Ignore ChannelParticipantLeft while iterating the members list

This commit is contained in:
Manuel 2021-12-21 21:04:42 +01:00
parent f9643bf737
commit aee4685413

View File

@ -233,6 +233,10 @@ class _ParticipantsIter(RequestIter):
users = {user.id: user for user in participants.users} users = {user.id: user for user in participants.users}
for participant in participants.participants: for participant in participants.participants:
if isinstance(participant, types.ChannelParticipantLeft):
# These participants should be ignored. See #3231.
continue
if isinstance(participant, types.ChannelParticipantBanned): if isinstance(participant, types.ChannelParticipantBanned):
if not isinstance(participant.peer, types.PeerUser): if not isinstance(participant.peer, types.PeerUser):
# May have the entire channel banned. See #3105. # May have the entire channel banned. See #3105.