From aee4685413698d06b4d98b40d1d5e350b327bca6 Mon Sep 17 00:00:00 2001 From: Manuel <> Date: Tue, 21 Dec 2021 21:04:42 +0100 Subject: [PATCH] Ignore ChannelParticipantLeft while iterating the members list --- telethon/client/chats.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/telethon/client/chats.py b/telethon/client/chats.py index dfbeddcc..4fb3dced 100644 --- a/telethon/client/chats.py +++ b/telethon/client/chats.py @@ -233,6 +233,10 @@ class _ParticipantsIter(RequestIter): users = {user.id: user for user in participants.users} for participant in participants.participants: + if isinstance(participant, types.ChannelParticipantLeft): + # These participants should be ignored. See #3231. + continue + if isinstance(participant, types.ChannelParticipantBanned): if not isinstance(participant.peer, types.PeerUser): # May have the entire channel banned. See #3105.