Fix voice states being overwritten after a GUILD_SYNC.

This was a two-fold problem. The first of which involved the overwriting
of members during a GUILD_SYNC. Since we are requesting a chunk anyway,
we have all the member references we need without actually chunking. The
second problem came from the order. We were doing a GUILD_SYNC and then
doing the chunking requests. We should do the GUILD_SYNC after the
chunking in order to just update presences.
This commit is contained in:
Rapptz
2016-06-28 19:07:56 -04:00
parent 1aceb4ee8d
commit d87d11c5a6
2 changed files with 17 additions and 15 deletions

View File

@ -186,6 +186,10 @@ class ConnectionState:
# remove the state
del self._ready_state
# call GUILD_SYNC after we're done chunking
if not self.is_bot:
compat.create_task(self.syncer([s.id for s in self.servers]), loop=self.loop)
# dispatch the event
self.dispatch('ready')
@ -200,9 +204,6 @@ class ConnectionState:
if server.large or not self.is_bot:
servers.append(server)
if not self.is_bot:
compat.create_task(self.syncer([s.id for s in self.servers]), loop=self.loop)
for pm in data.get('private_channels'):
self._add_private_channel(PrivateChannel(id=pm['id'],
user=User(**pm['recipient'])))