From d87d11c5a66a0b2684fe606d0bbbe14e74fcc46d Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 28 Jun 2016 19:07:56 -0400 Subject: 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. --- discord/state.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'discord/state.py') diff --git a/discord/state.py b/discord/state.py index 02ee04f1..7fc8debc 100644 --- a/discord/state.py +++ b/discord/state.py @@ -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']))) -- cgit v1.2.3