diff options
| author | Rapptz <[email protected]> | 2018-03-06 00:15:26 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2018-03-06 00:15:36 -0500 |
| commit | a425bd91be1996c92a39a66e27eea7de02a34027 (patch) | |
| tree | 1fca9d0235966e0e03881985e9958d7dec435b29 | |
| parent | Add ability to change the activity used when logging in at runtime. (diff) | |
| download | discord.py-a425bd91be1996c92a39a66e27eea7de02a34027.tar.xz discord.py-a425bd91be1996c92a39a66e27eea7de02a34027.zip | |
Fix invalid close errors on websockets 4.x
Fixes #1110
| -rw-r--r-- | discord/gateway.py | 2 | ||||
| -rw-r--r-- | discord/voice_client.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/discord/gateway.py b/discord/gateway.py index 7bd7c8de..4e100753 100644 --- a/discord/gateway.py +++ b/discord/gateway.py @@ -70,7 +70,7 @@ class KeepAliveHandler(threading.Thread): while not self._stop_ev.wait(self.interval): if self._last_ack + self.heartbeat_timeout < time.monotonic(): log.warn("Shard ID %s has stopped responding to the gateway. Closing and restarting." % self.shard_id) - coro = self.ws.close(1006) + coro = self.ws.close(4000) f = compat.run_coroutine_threadsafe(coro, loop=self.ws.loop) try: diff --git a/discord/voice_client.py b/discord/voice_client.py index 04711d58..f892bdb9 100644 --- a/discord/voice_client.py +++ b/discord/voice_client.py @@ -190,7 +190,7 @@ class VoiceClient: if self._handshake_complete.is_set(): # terminate the websocket and handle the reconnect loop if necessary. self._handshake_complete.clear() - yield from self.ws.close(1006) + yield from self.ws.close(4000) return self._handshake_complete.set() |