From 9e0cb93c43633a94c1a49bbdc33774549bc50fdd Mon Sep 17 00:00:00 2001 From: Lala Sabathil Date: Thu, 29 Feb 2024 20:12:08 +0100 Subject: [PATCH] Update iterators.py Signed-off-by: Lala Sabathil --- discord/iterators.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/discord/iterators.py b/discord/iterators.py index 8a1a5d74c3..50e2e0bb99 100644 --- a/discord/iterators.py +++ b/discord/iterators.py @@ -494,14 +494,9 @@ def __init__( self.after = after or OLDEST_OBJECT self._users = {} self._state = guild._state - - self._filter = None # entry dict -> bool - self.entries = asyncio.Queue() - self._strategy = self._strategy_exec - - async def _strategy_exec(self, retrieve): + async def _retrieve_auditlogs(self, retrieve): before = self.before.id if self.before else None after = self.after.id if self.after else None data: AuditLogPayload = await self.request( @@ -545,13 +540,10 @@ async def _fill(self): from .user import User if self._get_retrieve(): - users, data = await self._strategy(self.retrieve) + users, data = await self._retrieve_auditlogs(self.retrieve) if len(data) < 100: self.limit = 0 # terminate the infinite loop - if self._filter: - data = filter(self._filter, data) - for user in users: u = User(data=user, state=self._state) self._users[u.id] = u