[V3 Downloader] List all loaded and unloaded cogs (#1019)

* Working without core cogs

* Working with core cogs

* Fix path search logic

* Fix docstring

* Type fix
This commit is contained in:
Will
2017-10-22 21:13:23 -04:00
committed by GitHub
parent 3febc94871
commit d346216fa2
2 changed files with 42 additions and 1 deletions

View File

@@ -185,6 +185,29 @@ 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
await ctx.send(
box(
"+ Loaded\n{}\n- Unloaded\n{}".format(
', '.join(sorted(loaded)), ', '.join(sorted(unloaded))
),
lang='diff'
)
)
@commands.group()
@checks.is_owner()
async def repo(self, ctx):