aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-03-05 19:45:13 -0500
committerRapptz <[email protected]>2019-03-05 19:45:13 -0500
commit78459f3ed02b309922683e7181cdad070eb215c9 (patch)
treef462d8614bc06b7f90c3acda23eb7332fd6e8306
parent[commands] Allow passing of typing.Union into Greedy. Fix #1951 (diff)
downloaddiscord.py-78459f3ed02b309922683e7181cdad070eb215c9.tar.xz
discord.py-78459f3ed02b309922683e7181cdad070eb215c9.zip
Don't reconnect during 4014/4015 in voice websocket.
-rw-r--r--discord/voice_client.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/discord/voice_client.py b/discord/voice_client.py
index 6bd293c7..80ed9b76 100644
--- a/discord/voice_client.py
+++ b/discord/voice_client.py
@@ -232,7 +232,11 @@ class VoiceClient:
await self.ws.poll_event()
except (ConnectionClosed, asyncio.TimeoutError) as exc:
if isinstance(exc, ConnectionClosed):
- if exc.code == 1000:
+ # The following close codes are undocumented so I will document them here.
+ # 1000 - normal closure (obviously)
+ # 4014 - voice channel has been deleted.
+ # 4015 - voice server has crashed
+ if exc.code in (1000, 4014, 4015):
await self.disconnect()
break