From 5461bfb4752dad1c0b9d9792c4993bac1f0105af Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 21 Mar 2017 03:32:09 -0400 Subject: Check if we're closed before attempting to do a reconnect. --- discord/client.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'discord/client.py') diff --git a/discord/client.py b/discord/client.py index 8ba5b7b3..e9f5a8ff 100644 --- a/discord/client.py +++ b/discord/client.py @@ -399,6 +399,9 @@ class Client: yield from self.close() raise + if self.is_closed(): + return + # We should only get this when an unhandled close code happens, # such as a clean disconnect (1000) or a bad state (bad token, no sharding, etc) # sometimes, discord sends us 1000 for unknown reasons so we should reconnect -- cgit v1.2.3