[V3 Core] Moved [p]cogs command to CogManager (#1076)

* Move cogs command to CogManager

* Move cogs command to CogManager

* self.bot -> ctx.bot

* Typing

* Missing import
This commit is contained in:
aikaterna
2017-11-05 10:05:29 -08:00
committed by Will
parent 2c6af90703
commit ef6dbee516
2 changed files with 24 additions and 23 deletions

View File

@@ -185,28 +185,6 @@ class Downloader:
elif target.is_file():
os.remove(str(target))
@commands.command()
@checks.is_owner()
async def cogs(self, ctx):
"""
Lists all loaded and available cogs.
"""
loaded = set(self.bot.extensions.keys())
all = set(await self.bot.cog_mgr.available_modules())
unloaded = all - loaded
msg = ("+ Loaded\n"
"{}\n\n"
"- Unloaded\n"
"{}"
"".format(", ".join(sorted(loaded)),
", ".join(sorted(unloaded)))
)
for page in pagify(msg, [" "], shorten_by=18):
await ctx.send(box(page.lstrip(" "), lang="diff"))
@commands.group()
@checks.is_owner()