From c4b45fe512f71776f8d4ef6698b88ed8bc4606c9 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sun, 10 Jul 2022 12:50:41 +0100 Subject: Update help command to work with root_aliases Specifying root_aliases causes bookmark delete to be registered as a command rather than subcommand, which causes it to be listed even though subcommands usually aren't, and this isn't done correctly. Co-authored-by: wookie184 --- bot/exts/core/help.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bot/exts/core/help.py') diff --git a/bot/exts/core/help.py b/bot/exts/core/help.py index b5df70ca..7d8066df 100644 --- a/bot/exts/core/help.py +++ b/bot/exts/core/help.py @@ -286,7 +286,7 @@ class HelpSession: else: results.append(f"<{name}>") - return f"{cmd.name} {' '.join(results)}" + return f"{cmd.qualified_name} {' '.join(results)}" async def build_pages(self) -> None: """Builds the list of content pages to be paginated through in the help message, as a list of str.""" @@ -313,6 +313,8 @@ class HelpSession: prefix = constants.Client.prefix signature = self._get_command_params(self.query) + paginator.add_line(f"**```\n{prefix}{signature}\n```**") + parent = self.query.full_parent_name + " " if self.query.parent else "" paginator.add_line(f"**```\n{prefix}{parent}{signature}\n```**") aliases = [f"`{alias}`" if not parent else f"`{parent}{alias}`" for alias in self.query.aliases] -- cgit v1.2.3 From aa2cdf594892b563f3d8ba24aa4f04d43a85e331 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Thu, 18 Aug 2022 18:34:51 +0100 Subject: Don't output command name twice in help command --- bot/exts/core/help.py | 1 - 1 file changed, 1 deletion(-) (limited to 'bot/exts/core/help.py') diff --git a/bot/exts/core/help.py b/bot/exts/core/help.py index 7d8066df..7384c27d 100644 --- a/bot/exts/core/help.py +++ b/bot/exts/core/help.py @@ -316,7 +316,6 @@ class HelpSession: paginator.add_line(f"**```\n{prefix}{signature}\n```**") parent = self.query.full_parent_name + " " if self.query.parent else "" - paginator.add_line(f"**```\n{prefix}{parent}{signature}\n```**") aliases = [f"`{alias}`" if not parent else f"`{parent}{alias}`" for alias in self.query.aliases] aliases += [f"`{alias}`" for alias in getattr(self.query, "root_aliases", ())] aliases = ", ".join(sorted(aliases)) -- cgit v1.2.3 From 702144d1ac88696cf045f12e1972cfe6f58335e5 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Thu, 18 Aug 2022 18:35:25 +0100 Subject: Allow help in DMs Since there are some comands that work in DMs, we should allow the command to be ran there. --- bot/exts/core/help.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bot/exts/core/help.py') diff --git a/bot/exts/core/help.py b/bot/exts/core/help.py index 7384c27d..eb7a9762 100644 --- a/bot/exts/core/help.py +++ b/bot/exts/core/help.py @@ -13,6 +13,7 @@ from bot import constants from bot.bot import Bot from bot.constants import Emojis from bot.utils.commands import get_command_suggestions +from bot.utils.decorators import whitelist_override from bot.utils.pagination import FIRST_EMOJI, LAST_EMOJI, LEFT_EMOJI, LinePaginator, RIGHT_EMOJI DELETE_EMOJI = Emojis.trashcan @@ -512,6 +513,7 @@ class Help(DiscordCog): """Custom Embed Pagination Help feature.""" @commands.command("help") + @whitelist_override(allow_dm=True) async def new_help(self, ctx: Context, *commands) -> None: """Shows Command Help.""" try: -- cgit v1.2.3