gateway.websocket: fix async guild dispatch for bots

get_guild is an incomplete guild object which isn't
suitable for any client.
This commit is contained in:
Luna 2018-12-04 04:36:46 -03:00
parent 214bef0371
commit 6b35c73ad6
1 changed files with 6 additions and 4 deletions

View File

@ -245,13 +245,15 @@ class GatewayWebsocket:
return
for guild_obj in unavailable_guilds:
guild = await self.storage.get_guild(guild_obj['id'],
self.state.user_id)
# fetch full guild object including the 'large' field
guild = await self.storage.get_guild_full(
int(guild_obj['id']), self.state.user_id, self.state.large
)
if not guild:
if guild is None:
continue
await self.dispatch('GUILD_CREATE', dict(guild))
await self.dispatch('GUILD_CREATE', guild)
async def user_ready(self):
"""Fetch information about users in the READY packet.