diff options
| author | Gorialis <[email protected]> | 2018-09-26 02:19:42 +0900 |
|---|---|---|
| committer | Gorialis <[email protected]> | 2018-09-26 02:19:42 +0900 |
| commit | e29e3438ec3742327d12b726dfd9b7194eb6b4d1 (patch) | |
| tree | ab7c073b73120c243d1a933be11958a5978fe83c | |
| parent | Fix NameError and duplicate insertion bug when moving roles. (diff) | |
| download | discord.py-e29e3438ec3742327d12b726dfd9b7194eb6b4d1.tar.xz discord.py-e29e3438ec3742327d12b726dfd9b7194eb6b4d1.zip | |
Don't try to close shards if there are none yet.
| -rw-r--r-- | discord/shard.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/discord/shard.py b/discord/shard.py index d0da4151..1f73b0de 100644 --- a/discord/shard.py +++ b/discord/shard.py @@ -286,7 +286,9 @@ class AutoShardedClient(Client): pass to_close = [shard.ws.close() for shard in self.shards.values()] - await asyncio.wait(to_close, loop=self.loop) + if to_close: + await asyncio.wait(to_close, loop=self.loop) + await self.http.close() async def change_presence(self, *, activity=None, status=None, afk=False, shard_id=None): |