mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Fix return value of Guild.chunk
This commit is contained in:
parent
8d86ee3fe3
commit
4a76464ac9
@ -3390,7 +3390,7 @@ class Guild(Hashable):
|
||||
|
||||
await self._state.http.edit_widget(self.id, payload=payload, reason=reason)
|
||||
|
||||
async def chunk(self, *, cache: bool = True) -> None:
|
||||
async def chunk(self, *, cache: bool = True) -> List[Member]:
|
||||
"""|coro|
|
||||
|
||||
Requests all members that belong to this guild. In order to use this,
|
||||
@ -3409,13 +3409,20 @@ class Guild(Hashable):
|
||||
-------
|
||||
ClientException
|
||||
The members intent is not enabled.
|
||||
|
||||
Returns
|
||||
--------
|
||||
List[:class:`Member`]
|
||||
The list of 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):
|
||||
await self._state.chunk_guild(self, cache=cache)
|
||||
return await self._state.chunk_guild(self, cache=cache)
|
||||
|
||||
return []
|
||||
|
||||
async def query_members(
|
||||
self,
|
||||
|
Loading…
x
Reference in New Issue
Block a user