mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-13 05:15:22 +00:00
Update voice client main ws references when reconnecting.
This commit is contained in:
parent
e0a91df32b
commit
8638ff4414
@ -199,6 +199,8 @@ class DiscordWebSocket(websockets.client.WebSocketClientProtocol):
|
|||||||
ws._dispatch = client.dispatch
|
ws._dispatch = client.dispatch
|
||||||
ws.gateway = gateway
|
ws.gateway = gateway
|
||||||
|
|
||||||
|
client.connection._update_references(ws)
|
||||||
|
|
||||||
log.info('Created websocket connected to {}'.format(gateway))
|
log.info('Created websocket connected to {}'.format(gateway))
|
||||||
if not resume:
|
if not resume:
|
||||||
yield from ws.identify()
|
yield from ws.identify()
|
||||||
|
@ -107,6 +107,10 @@ class ConnectionState:
|
|||||||
def _remove_voice_client(self, guild_id):
|
def _remove_voice_client(self, guild_id):
|
||||||
self._voice_clients.pop(guild_id, None)
|
self._voice_clients.pop(guild_id, None)
|
||||||
|
|
||||||
|
def _update_references(self, ws):
|
||||||
|
for vc in self.voice_clients:
|
||||||
|
vc.main_ws = ws
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def servers(self):
|
def servers(self):
|
||||||
return self._servers.values()
|
return self._servers.values()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user