mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-07 09:52:30 -05:00
Black ofc
This commit is contained in:
@@ -947,7 +947,8 @@ class Downloader(commands.Cog):
|
|||||||
"\nIt was most likely removed without using `{prefix}cog uninstall`.\n"
|
"\nIt was most likely removed without using `{prefix}cog uninstall`.\n"
|
||||||
"You may need to remove those files manually if the cog is still usable."
|
"You may need to remove those files manually if the cog is still usable."
|
||||||
" If so, ensure the cog has been unloaded with {command}."
|
" If so, ensure the cog has been unloaded with {command}."
|
||||||
).format(command=inline(f"{ctx.clean_prefix}unload {failed_cogs[0]}")
|
).format(
|
||||||
|
command=inline(f"{ctx.clean_prefix}unload {failed_cogs[0]}")
|
||||||
)
|
)
|
||||||
await self.send_pagified(ctx, message)
|
await self.send_pagified(ctx, message)
|
||||||
|
|
||||||
@@ -1270,11 +1271,7 @@ class Downloader(commands.Cog):
|
|||||||
- `<repo>` The repo to list cogs from.
|
- `<repo>` The repo to list cogs from.
|
||||||
"""
|
"""
|
||||||
all_installed_cogs = await self.installed_cogs()
|
all_installed_cogs = await self.installed_cogs()
|
||||||
installed_cogs_in_repo = [
|
installed_cogs_in_repo = [cog for cog in all_installed_cogs if cog.repo_name == repo.name]
|
||||||
cog
|
|
||||||
for cog in all_installed_cogs
|
|
||||||
if cog.repo_name == repo.name
|
|
||||||
]
|
|
||||||
installed_str = "\n".join(
|
installed_str = "\n".join(
|
||||||
"- {}{}".format(i.name, ": {}".format(i.short) if i.short else "")
|
"- {}{}".format(i.name, ": {}".format(i.short) if i.short else "")
|
||||||
for i in installed_cogs_in_repo
|
for i in installed_cogs_in_repo
|
||||||
@@ -1283,20 +1280,15 @@ class Downloader(commands.Cog):
|
|||||||
if not installed_str:
|
if not installed_str:
|
||||||
installed_str = _("No cogs installed.")
|
installed_str = _("No cogs installed.")
|
||||||
elif len(installed_cogs_in_repo) > 1:
|
elif len(installed_cogs_in_repo) > 1:
|
||||||
installed_str = (
|
installed_str = _("Installed Cogs:\n{text}").format(text=installed_str)
|
||||||
_("Installed Cogs:\n{text}").format(text=installed_str)
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
installed_str = (
|
installed_str = _("Installed Cog:\n{text}").format(text=installed_str)
|
||||||
_("Installed Cog:\n{text}").format(text=installed_str)
|
|
||||||
)
|
|
||||||
available_str = "\n".join(
|
available_str = "\n".join(
|
||||||
"+ {}{}".format(cog.name, ": {}".format(cog.short) if cog.short else "")
|
"+ {}{}".format(cog.name, ": {}".format(cog.short) if cog.short else "")
|
||||||
for cog in repo.available_cogs
|
for cog in repo.available_cogs
|
||||||
if not (cog.hidden or cog in installed_cogs_in_repo)
|
if not (cog.hidden or cog in installed_cogs_in_repo)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
available_cogs = sum(
|
available_cogs = sum(
|
||||||
not cog.hidden and cog not in installed_cogs_in_repo for cog in repo.available_cogs
|
not cog.hidden and cog not in installed_cogs_in_repo for cog in repo.available_cogs
|
||||||
)
|
)
|
||||||
@@ -1304,13 +1296,9 @@ class Downloader(commands.Cog):
|
|||||||
if not available_str:
|
if not available_str:
|
||||||
cogs = _("No cogs available.")
|
cogs = _("No cogs available.")
|
||||||
elif available_cogs > 1:
|
elif available_cogs > 1:
|
||||||
cogs = (
|
cogs = _("Available Cogs:\n{text}").format(text=available_str)
|
||||||
_("Available Cogs:\n{text}").format(text=available_str)
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
cogs = (
|
cogs = _("Available Cog:\n{text}").format(text=available_str)
|
||||||
_("Available Cog:\n{text}").format(text=available_str)
|
|
||||||
)
|
|
||||||
cogs = cogs + "\n\n" + installed_str
|
cogs = cogs + "\n\n" + installed_str
|
||||||
for page in pagify(cogs, ["\n"], shorten_by=16):
|
for page in pagify(cogs, ["\n"], shorten_by=16):
|
||||||
await ctx.send(box(page.lstrip(" "), lang="diff"))
|
await ctx.send(box(page.lstrip(" "), lang="diff"))
|
||||||
|
|||||||
Reference in New Issue
Block a user