From 1d34e9e47bc8d56c9b4d2e062477423535e710de Mon Sep 17 00:00:00 2001 From: Dav Date: Sat, 16 Oct 2021 02:10:57 +0200 Subject: [PATCH] [Downloader] Show repo name in findcog (#5383) * show repo name in findcog * how did i manage to overcomplicate this? * for Kreusada * I wanted to do that... but forgot --- redbot/cogs/downloader/downloader.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/redbot/cogs/downloader/downloader.py b/redbot/cogs/downloader/downloader.py index 4822c8bf3..5a81f115d 100644 --- a/redbot/cogs/downloader/downloader.py +++ b/redbot/cogs/downloader/downloader.py @@ -1730,15 +1730,22 @@ class Downloader(commands.Cog): if cog_installable.repo is None else cog_installable.repo.clean_url ) + repo_name = ( + _("Missing from installed repos") + if cog_installable.repo is None + else cog_installable.repo.name + ) cog_name = cog_installable.name elif cog.__module__.startswith("redbot."): # core commands or core cog made_by = "Cog Creators" repo_url = "https://github.com/Cog-Creators/Red-DiscordBot" cog_name = cog.__class__.__name__ + repo_name = "Red-DiscordBot" else: # assume not installed via downloader made_by = _("Unknown") repo_url = _("None - this cog wasn't installed via downloader") cog_name = cog.__class__.__name__ + repo_name = _("Unknown") else: msg = _("This command is not provided by a cog.") await ctx.send(msg) @@ -1747,8 +1754,9 @@ class Downloader(commands.Cog): if await ctx.embed_requested(): embed = discord.Embed(color=(await ctx.embed_colour())) embed.add_field(name=_("Command:"), value=command_name, inline=False) - embed.add_field(name=_("Cog Name:"), value=cog_name, inline=False) + embed.add_field(name=_("Cog name:"), value=cog_name, inline=False) embed.add_field(name=_("Made by:"), value=made_by, inline=False) + embed.add_field(name=_("Repo name:"), value=repo_name, inline=False) embed.add_field(name=_("Repo URL:"), value=repo_url, inline=False) if installed and cog_installable.repo is not None and cog_installable.repo.branch: embed.add_field( @@ -1758,8 +1766,14 @@ class Downloader(commands.Cog): else: msg = _( - "Command: {command}\nCog name: {cog}\nMade by: {author}\nRepo URL: {repo_url}\n" - ).format(command=command_name, author=made_by, repo_url=repo_url, cog=cog_name) + "Command: {command}\nCog name: {cog}\nMade by: {author}\nRepo name: {repo_name}\nRepo URL: {repo_url}\n" + ).format( + command=command_name, + author=made_by, + repo_url=repo_url, + cog=cog_name, + repo_name=repo_name, + ) if installed and cog_installable.repo is not None and cog_installable.repo.branch: msg += _("Repo branch: {branch_name}\n").format( branch_name=cog_installable.repo.branch