aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/gateway.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/discord/gateway.py b/discord/gateway.py
index 35d92fe6..803c8c25 100644
--- a/discord/gateway.py
+++ b/discord/gateway.py
@@ -510,6 +510,12 @@ class DiscordWebSocket(websockets.client.WebSocketClientProtocol):
log.debug('Updating our voice state to %s.', payload)
await self.send_as_json(payload)
+ async def close(self, code=1000, reason=''):
+ if self._keep_alive:
+ self._keep_alive.stop()
+
+ await super().close(code, reason)
+
async def close_connection(self, *args, **kwargs):
if self._keep_alive:
self._keep_alive.stop()