Repository: Cog-Creators/Red-DiscordBot

Issue:
[Help] Add current settings to `[p]helpset` cmd
# Feature request


#### Select the type of feature you are requesting:

- [ ] Cog
- [x] Command
- [ ] API functionality

#### Describe your requested feature

Add current settings display (as in `[p]modset`/`[p]set`) for `[p]helpset` command



Discussion:
I would seriously prefer if there was an additional command to list settings rather than spit the settings out on a group that would otherwise only send help, especially with the behavior of help being opened up more to 3rd party customization.

Resolving patch:
diff --git a/redbot/core/commands/help.py b/redbot/core/commands/help.py
--- a/redbot/core/commands/help.py
+++ b/redbot/core/commands/help.py
@@ -30,7 +30,7 @@
 import abc
 import asyncio
 from collections import namedtuple
-from dataclasses import dataclass
+from dataclasses import dataclass, asdict as dc_asdict
 from typing import Union, List, AsyncIterator, Iterable, cast
 
 import discord
@@ -42,7 +42,7 @@
 from ..utils import menus
 from ..utils.mod import mass_purge
 from ..utils._internal_utils import fuzzy_command_search, format_fuzzy_results
-from ..utils.chat_formatting import box, pagify
+from ..utils.chat_formatting import box, pagify, humanize_timedelta
 
 __all__ = ["red_help", "RedHelpFormatter", "HelpSettings", "HelpFormatterABC"]
 
@@ -94,6 +94,42 @@ async def from_context(cls, context: Context):
         settings = await context.bot._config.help.all()
         return cls(**settings)
 
+    @property
+    def pretty(self):
+        """ Returns a discord safe representation of the settings """
+
+        def bool_transformer(val):
+            if val is False:
+                return _("No")
+            if val is True:
+                return _("Yes")
+            return val
+
+        data = {k: bool_transformer(v) for k, v in dc_asdict(self).items()}
+
+        if not self.delete_delay:
+            data["delete_delay"] = _("Disabled")
+        else:
+            data["delete_delay"] = humanize_timedelta(seconds=self.delete_delay)
+
+        if tag := data.pop("tagline", ""):
+            tagline_info = _("\nCustom Tagline: {tag}").format(tag=tag)
+        else:
+            tagline_info = ""
+
+        data["tagline_info"] = tagline_info
+
+        return _(
+            "Maximum characters per page: {page_char_limit}"
+            "\nMaximum pages per guild (only used if menus are not used): {max_pages_in_guild}"
+            "\nHelp is a menu: {use_menus}"
+            "\nHelp shows hidden commands: {show_hidden}"
+            "\nHelp only shows commands which can be used: {verify_checks}"
+            "\nHelp shows unusable commands when asked directly: {verify_exists}"
+            "\nDelete delay: {delete_delay}"
+            "{tagline_info}"
+        ).format_map(data)
+
 
 class NoCommand(Exception):
     pass
diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py
--- a/redbot/core/core_commands.py
+++ b/redbot/core/core_commands.py
@@ -2079,6 +2079,23 @@ async def helpset(self, ctx: commands.Context):
         """Manage settings for the help command."""
         pass
 
+    @helpset.command(name="showsettings")
+    async def helpset_showsettings(self, ctx: commands.Context):
+        """ Show the current help settings """
+
+        help_settings = await commands.help.HelpSettings.from_context(ctx)
+
+        if type(ctx.bot._help_formatter) is commands.help.RedHelpFormatter:
+            message = help_settings.pretty
+        else:
+            message = _(
+                "Warning: The default formatter is not in use, these settings may not apply"
+            )
+            message += f"\n\n{help_settings.pretty}"
+
+        for page in pagify(message):
+            await ctx.send(page)
+
     @helpset.command(name="resetformatter")
     async def helpset_resetformatter(self, ctx: commands.Context):
         """ This resets [botname]'s help formatter to the default formatter """


Test patch: