From 1c15375ea41183c42a7e6122c8744bc5db403822 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Tue, 28 Sep 2021 21:06:00 +0200 Subject: [PATCH] Fix get_participants was monkey-patching User It no longer can do that. User has __slots__. --- telethon/_client/chats.py | 3 --- telethon/_client/telegramclient.py | 5 +---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/telethon/_client/chats.py b/telethon/_client/chats.py index ffb68c0f..693feeab 100644 --- a/telethon/_client/chats.py +++ b/telethon/_client/chats.py @@ -167,7 +167,6 @@ class _ParticipantsIter(requestiter.RequestIter): continue user = users[user_id] - user.participant = participant self.buffer.append(user) return True @@ -176,7 +175,6 @@ class _ParticipantsIter(requestiter.RequestIter): if self.limit != 0: user = await self.client.get_entity(entity) if self.filter_entity(user): - user.participant = None self.buffer.append(user) return True @@ -213,7 +211,6 @@ class _ParticipantsIter(requestiter.RequestIter): continue self.seen.add(user_id) user = users[user_id] - user.participant = participant self.buffer.append(user) diff --git a/telethon/_client/telegramclient.py b/telethon/_client/telegramclient.py index 136718ab..bc4371f3 100644 --- a/telethon/_client/telegramclient.py +++ b/telethon/_client/telegramclient.py @@ -731,10 +731,7 @@ class TelegramClient: * ``'contact'`` Yields - The :tl:`User` objects returned by :tl:`GetParticipants` - with an additional ``.participant`` attribute which is the - matched :tl:`ChannelParticipant` type for channels/megagroups - or :tl:`ChatParticipants` for normal chats. + The :tl:`User` objects returned by :tl:`GetParticipants`. Example .. code-block:: python