mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-29 21:03:45 +03:00
Fix get_participants was monkey-patching User
It no longer can do that. User has __slots__.
This commit is contained in:
parent
197a1ca996
commit
1c15375ea4
|
@ -167,7 +167,6 @@ class _ParticipantsIter(requestiter.RequestIter):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
user = users[user_id]
|
user = users[user_id]
|
||||||
user.participant = participant
|
|
||||||
self.buffer.append(user)
|
self.buffer.append(user)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
@ -176,7 +175,6 @@ class _ParticipantsIter(requestiter.RequestIter):
|
||||||
if self.limit != 0:
|
if self.limit != 0:
|
||||||
user = await self.client.get_entity(entity)
|
user = await self.client.get_entity(entity)
|
||||||
if self.filter_entity(user):
|
if self.filter_entity(user):
|
||||||
user.participant = None
|
|
||||||
self.buffer.append(user)
|
self.buffer.append(user)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
@ -213,7 +211,6 @@ class _ParticipantsIter(requestiter.RequestIter):
|
||||||
continue
|
continue
|
||||||
self.seen.add(user_id)
|
self.seen.add(user_id)
|
||||||
user = users[user_id]
|
user = users[user_id]
|
||||||
user.participant = participant
|
|
||||||
self.buffer.append(user)
|
self.buffer.append(user)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -731,10 +731,7 @@ class TelegramClient:
|
||||||
* ``'contact'``
|
* ``'contact'``
|
||||||
|
|
||||||
Yields
|
Yields
|
||||||
The :tl:`User` objects returned by :tl:`GetParticipants`
|
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.
|
|
||||||
|
|
||||||
Example
|
Example
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
Loading…
Reference in New Issue
Block a user