[commands] Unload all extensions when gracefully closing bot.
This commit is contained in:
		| @@ -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| | ||||
|   | ||||
		Reference in New Issue
	
	Block a user