Browse Source

Update voice client main ws references when reconnecting.

pull/237/head
Rapptz 9 years ago
parent
commit
8638ff4414
  1. 2
      discord/gateway.py
  2. 4
      discord/state.py

2
discord/gateway.py

@ -199,6 +199,8 @@ class DiscordWebSocket(websockets.client.WebSocketClientProtocol):
ws._dispatch = client.dispatch
ws.gateway = gateway
client.connection._update_references(ws)
log.info('Created websocket connected to {}'.format(gateway))
if not resume:
yield from ws.identify()

4
discord/state.py

@ -107,6 +107,10 @@ class ConnectionState:
def _remove_voice_client(self, guild_id):
self._voice_clients.pop(guild_id, None)
def _update_references(self, ws):
for vc in self.voice_clients:
vc.main_ws = ws
@property
def servers(self):
return self._servers.values()

Loading…
Cancel
Save