Check if we're closed before attempting to do a reconnect.

This commit is contained in:
Rapptz
2017-03-21 03:32:09 -04:00
parent a0cdb19c5f
commit 5461bfb475
2 changed files with 5 additions and 1 deletions

View File

@ -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):