Add Guild.query_members to fetch members from the gateway.

This commit is contained in:
Rapptz
2019-07-15 07:56:35 -04:00
parent bc352f0e50
commit 5b2f630848
4 changed files with 97 additions and 8 deletions

View File

@ -323,11 +323,13 @@ async def async_all(gen, *, check=_isawaitable):
return True
async def sane_wait_for(futures, *, timeout, loop):
_, pending = await asyncio.wait(futures, timeout=timeout, loop=loop)
done, pending = await asyncio.wait(futures, timeout=timeout, return_when=asyncio.ALL_COMPLETED, loop=loop)
if len(pending) != 0:
raise asyncio.TimeoutError()
return done
def valid_icon_size(size):
"""Icons must be power of 2 within [16, 4096]."""
return not size & (size - 1) and size in range(16, 4097)