aboutsummaryrefslogtreecommitdiff
path: root/discord/gateway.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-05-06 13:30:44 -0400
committerRapptz <[email protected]>2016-05-06 13:30:44 -0400
commit701720a0f802c20d283c197aa7ea9a74f628c0cb (patch)
tree956e7ff58a4dcd2ab503e7653b0dc7670ca3e140 /discord/gateway.py
parentSuppress ConnectionClosed on sending in the main websocket. (diff)
downloaddiscord.py-701720a0f802c20d283c197aa7ea9a74f628c0cb.tar.xz
discord.py-701720a0f802c20d283c197aa7ea9a74f628c0cb.zip
Add a TimeoutError if VoiceClient.connect fails.
Diffstat (limited to 'discord/gateway.py')
-rw-r--r--discord/gateway.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/discord/gateway.py b/discord/gateway.py
index 661607b2..7ed7371b 100644
--- a/discord/gateway.py
+++ b/discord/gateway.py
@@ -553,7 +553,7 @@ class DiscordVoiceWebSocket(websockets.client.WebSocketClientProtocol):
@asyncio.coroutine
def poll_event(self):
try:
- msg = yield from self.recv()
+ msg = yield from asyncio.wait_for(self.recv(), timeout=30.0, loop=self.loop)
yield from self.received_message(json.loads(msg))
except websockets.exceptions.ConnectionClosed as e:
raise ConnectionClosed(e) from e