mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-08 12:18:54 -05:00
[V3 Downloader] Split available and installed cogs (#1826)
This commit is contained in:
parent
fd7088de1a
commit
94a64d8fae
@ -380,11 +380,21 @@ class Downloader:
|
|||||||
"""
|
"""
|
||||||
Lists all available cogs from a single repo.
|
Lists all available cogs from a single repo.
|
||||||
"""
|
"""
|
||||||
|
installed = await self.installed_cogs()
|
||||||
|
installed_str = ""
|
||||||
|
if installed:
|
||||||
|
installed_str = _("Installed Cogs:\n") + "\n".join(
|
||||||
|
[
|
||||||
|
"- {}{}".format(i.name, ": {}".format(i.short) if i.short else "")
|
||||||
|
for i in installed
|
||||||
|
if i.repo_name == repo_name.name
|
||||||
|
]
|
||||||
|
)
|
||||||
cogs = repo_name.available_cogs
|
cogs = repo_name.available_cogs
|
||||||
cogs = _("Available Cogs:\n") + "\n".join(
|
cogs = _("Available Cogs:\n") + "\n".join(
|
||||||
["+ {}: {}".format(c.name, c.short or "") for c in cogs]
|
["+ {}: {}".format(c.name, c.short or "") for c in cogs if c not in installed]
|
||||||
)
|
)
|
||||||
|
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"))
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user