mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-07 01:42:30 -05:00
Simplify
This commit is contained in:
@@ -1283,19 +1283,18 @@ class Downloader(commands.Cog):
|
||||
installed_str = _("Installed Cogs:\n{text}").format(text=installed_str)
|
||||
elif installed_cogs_in_repo:
|
||||
installed_str = _("Installed Cog:\n{text}").format(text=installed_str)
|
||||
|
||||
available_cogs = [
|
||||
cog for cog in repo.available_cogs if not (cog.hidden or cog in installed_cogs_in_repo)
|
||||
]
|
||||
available_str = "\n".join(
|
||||
"+ {}{}".format(cog.name, ": {}".format(cog.short) if cog.short else "")
|
||||
for cog in repo.available_cogs
|
||||
if not (cog.hidden or cog in installed_cogs_in_repo)
|
||||
)
|
||||
|
||||
available_cogs = sum(
|
||||
not cog.hidden and cog not in installed_cogs_in_repo for cog in repo.available_cogs
|
||||
for cog in available_cogs
|
||||
)
|
||||
|
||||
if not available_str:
|
||||
cogs = _("Available Cogs:\nNo cogs are available.")
|
||||
elif available_cogs > 1:
|
||||
elif len(available_cogs) > 1:
|
||||
cogs = _("Available Cogs:\n{text}").format(text=available_str)
|
||||
else:
|
||||
cogs = _("Available Cog:\n{text}").format(text=available_str)
|
||||
|
||||
Reference in New Issue
Block a user