Repository: Cog-Creators/Red-DiscordBot

Issue:
Use CamelCase in the [p]findcog command.
### Type of feature request

Cog, Command

### Description of the feature you're suggesting

In the `[p]findcog` command, all the cogs installed using downloader don't use CamelCase under the Cog Name field.

### Anything else?

_No response_


Discussion:
Currently, the `Cog Name` field uses the `name` info.json key if the cog is installed via downloader, and the class name otherwise. It should probably be made consistent, and making it the class name would make it easier to find help for a cog from a command. Unless there is some reason to show the `name` field that I'm not thinking of, this should be an acceptable change.
Instead of replacing the cog name (#5519), putting the class's name between parentheses next to the cog's name could do the trick?
I don't agree with this change, I consider package name (the name that is currently shown for Downloader-installed cogs in `[p]findcog`) to be more useful - *every* command in Downloader, as well as `[p]load/unload/reload` commands requires *this* name as an argument, not the class name. If anything, we should instead try to figure out a package name for the other cases, not use the class name for Downloader-installed cogs.
I'm not sure that such a package name could always be fully accurate but it's IMO more useful to have it this way.
Another option would be to just put both cog package name and class name into `[p]findcog`. The output of the command is getting somewhat long so perhaps doing it in parentheses as @Predeactor said would be preferable over adding another field.
fair, so something like this should do the trick. https://rick-roll.click-if-you-da.re/5jYP8g0Za.png , made the changes required.



Resolving patch:
diff --git a/redbot/cogs/downloader/downloader.py b/redbot/cogs/downloader/downloader.py
--- a/redbot/cogs/downloader/downloader.py
+++ b/redbot/cogs/downloader/downloader.py
@@ -1741,8 +1741,8 @@ async def findcog(self, ctx: commands.Context, command_name: str) -> None:
         # Check if in installed cogs
         cog = command.cog
         if cog:
-            cog_name = self.cog_name_from_instance(cog)
-            installed, cog_installable = await self.is_installed(cog_name)
+            cog_pkg_name = self.cog_name_from_instance(cog)
+            installed, cog_installable = await self.is_installed(cog_pkg_name)
             if installed:
                 made_by = (
                     humanize_list(cog_installable.author)
@@ -1759,17 +1759,21 @@ async def findcog(self, ctx: commands.Context, command_name: str) -> None:
                     if cog_installable.repo is None
                     else cog_installable.repo.name
                 )
-                cog_name = cog_installable.name
+                cog_pkg_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__
+                module_fragments = cog.__module__.split(".")
+                if module_fragments[1] == "core":
+                    cog_pkg_name = "N/A - Built-in commands"
+                else:
+                    cog_pkg_name = module_fragments[2]
                 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")
+            cog_name = cog.__class__.__name__
         else:
             msg = _("This command is not provided by a cog.")
             await ctx.send(msg)
@@ -1778,7 +1782,8 @@ async def findcog(self, ctx: commands.Context, command_name: str) -> None:
         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 package name:"), value=cog_pkg_name, inline=True)
+            embed.add_field(name=_("Cog name:"), value=cog_name, inline=True)
             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)
@@ -1790,12 +1795,18 @@ async def findcog(self, ctx: commands.Context, command_name: str) -> None:
 
         else:
             msg = _(
-                "Command: {command}\nCog name: {cog}\nMade by: {author}\nRepo name: {repo_name}\nRepo URL: {repo_url}\n"
+                "Command:          {command}\n"
+                "Cog package name: {cog_pkg}\n"
+                "Cog name:         {cog}\n"
+                "Made by:          {author}\n"
+                "Repo name:        {repo_name}\n"
+                "Repo URL:         {repo_url}\n"
             ).format(
                 command=command_name,
+                cog_pkg=cog_pkg_name,
+                cog=cog_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:


Test patch: