mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 09:56:05 -05:00
[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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user