diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index fd7881821..9025493d9 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -266,6 +266,16 @@ class Bot(GroupMixin, discord.Client): coro = self._run_extra(event, event_name, *args, **kwargs) 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|