aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJake <[email protected]>2016-06-13 01:43:55 -0700
committerGitHub <[email protected]>2016-06-13 01:43:55 -0700
commitf6ef4868d1b886cc851d2d237edc51f70c4d45c9 (patch)
treecae190580402d5dfd20ccf83d1d520238efcde79
parentDocument Server.large (diff)
downloaddiscord.py-f6ef4868d1b886cc851d2d237edc51f70c4d45c9.tar.xz
discord.py-f6ef4868d1b886cc851d2d237edc51f70c4d45c9.zip
Fix concurrently joining more than one voice server at a time
-rw-r--r--discord/client.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/discord/client.py b/discord/client.py
index b7c5b802..9ea3f20b 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -2399,11 +2399,12 @@ class Client:
def session_id_found(data):
user_id = data.get('user_id')
- return user_id == self.user.id
+ guild_id = data.get('guild_id')
+ return user_id == self.user.id and guild_id == server.id
# register the futures for waiting
session_id_future = self.ws.wait_for('VOICE_STATE_UPDATE', session_id_found)
- voice_data_future = self.ws.wait_for('VOICE_SERVER_UPDATE', lambda d: True)
+ voice_data_future = self.ws.wait_for('VOICE_SERVER_UPDATE', lambda d: d.get('guild_id') == server.id)
# request joining
yield from self.ws.voice_state(server.id, channel.id)