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/shard.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'discord/shard.py') diff --git a/discord/shard.py b/discord/shard.py index ab0ca31f..8fad51e9 100644 --- a/discord/shard.py +++ b/discord/shard.py @@ -234,11 +234,12 @@ class AutoShardedClient(Client): if self.is_closed(): return + self._closed.set() + for shard in self.shards.values(): yield from shard.ws.close() yield from self.http.close() - self._closed.set() @asyncio.coroutine def change_presence(self, *, game=None, status=None, afk=False, shard_id=None): -- cgit v1.2.3