diff options
| -rw-r--r-- | discord/ext/commands/bot.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index fd788182..9025493d 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -267,6 +267,16 @@ class Bot(GroupMixin, discord.Client): discord.compat.create_task(coro, loop=self.loop) @asyncio.coroutine + def close(self): + for extension in self.extensions: + try: + self.unload_extension(extension) + except: + pass + + yield from super().close() + + @asyncio.coroutine def on_command_error(self, exception, context): """|coro| |