From 987e27dfce24b6445ac6160561c93970fcfafcb4 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 7 Mar 2022 22:14:38 -0500 Subject: [PATCH] Revert all Guild.chunk changes This method should *not* return a list of members due to the way it is used internally. --- discord/guild.py | 9 ++------- discord/state.py | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index 7f4d06045..8cae9775a 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -3375,7 +3375,7 @@ class Guild(Hashable): await self._state.http.edit_widget(self.id, payload=payload, reason=reason) - async def chunk(self, *, cache: bool = True) -> Optional[List[Member]]: + async def chunk(self, *, cache: bool = True) -> None: """|coro| Requests all members that belong to this guild. In order to use this, @@ -3394,18 +3394,13 @@ class Guild(Hashable): ------- ClientException The members intent is not enabled. - - Returns - -------- - Optional[List[:class:`Member`]] - Returns a list of all the members in the guild. """ if not self._state._intents.members: raise ClientException('Intents.members must be enabled to use this.') if not self._state.is_guild_evicted(self): - return await self._state.chunk_guild(self, cache=cache) + await self._state.chunk_guild(self, cache=cache) async def query_members( self, diff --git a/discord/state.py b/discord/state.py index ae4e3f42e..ef61471ab 100644 --- a/discord/state.py +++ b/discord/state.py @@ -1073,7 +1073,7 @@ class ConnectionState: if wait: return await request.wait() - return await request.get_future() + return request.get_future() async def _chunk_and_dispatch(self, guild, unavailable): try: