From 0dcc4c113f478654a0eb24f174eecbb58733e79b Mon Sep 17 00:00:00 2001 From: Jimmy-Blue <60958064+Jimmy-Blue@users.noreply.github.com> Date: Tue, 9 May 2023 13:26:28 +0700 Subject: [PATCH 1/4] fix: Fix the ascii text --- bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 4db9aa4..9da973a 100644 --- a/bot.py +++ b/bot.py @@ -97,7 +97,7 @@ async def on_startup() -> None: _ _ /\ | | (_) / \ _ __| |_ _ ___ _ _ _ __ ___ - / /\ \ | '__| __| |/ __| | | | '_ \ / _ \ + / /\ \ | '__| __| |/ __| | | | '_ \ / _ \\ / ____ \| | | |_| | (__| |_| | | | | (_) | /_/ \_\_| \__|_|\___|\__,_|_| |_|\___/ From 7a437543d11ecbebcd2787259c149089a3953ceb Mon Sep 17 00:00:00 2001 From: Jimmy-Blue <60958064+Jimmy-Blue@users.noreply.github.com> Date: Tue, 9 May 2023 13:26:54 +0700 Subject: [PATCH 2/4] feat: Change log level to `INFO` --- bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 9da973a..70d2c36 100644 --- a/bot.py +++ b/bot.py @@ -34,7 +34,7 @@ async def get_latest_release_version() -> str: logging.basicConfig( format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s", datefmt="%d/%m/%Y %H:%M:%S", - level=0, + level=logging.INFO, ) client = interactions.Client( From 564d106ffb5fe7a41a78c093727b9af62917c3c6 Mon Sep 17 00:00:00 2001 From: Jimmy-Blue <60958064+Jimmy-Blue@users.noreply.github.com> Date: Tue, 9 May 2023 13:27:22 +0700 Subject: [PATCH 3/4] fix: Fix subcommand and group command not display --- exts/core/help.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/exts/core/help.py b/exts/core/help.py index ba42dc1..7ee221d 100644 --- a/exts/core/help.py +++ b/exts/core/help.py @@ -33,7 +33,7 @@ async def help(self, ctx: interactions.SlashContext) -> None: self.client.application_commands ): if isinstance(command, interactions.SlashCommand): - if i == 15: + if i == 10: help_list.append(embed) i = 0 embed = interactions.Embed( @@ -44,18 +44,12 @@ async def help(self, ctx: interactions.SlashContext) -> None: ), ) - if command.sub_cmd_name is None: - embed.add_field( - name=f"/{command.name}", value=command.description - ) - else: - if str(command.sub_cmd_name) != "None": - embed.add_field( - name=f"/{command.name} {command.sub_cmd_name}", - value=f"{command.sub_cmd_description}", - ) - + embed.add_field( + name=f"/{command.name}" + (f" {command.group_name}" if str(command.group_name) != "None" else "") + (f" {command.sub_cmd_name}" if str(command.sub_cmd_name) != "None" else ""), + value=f"{command.sub_cmd_description}" if str(command.sub_cmd_name) != "None" else f"{command.description}" + ) i += 1 - paginator = Paginator.create_from_embeds(self.client, *help_list) + paginator = Paginator.create_from_embeds(self.client, *help_list, timeout=30) + print(help_list) await paginator.send(ctx) From 0be9bccd3fee41dd556b0785e87a1117ef575068 Mon Sep 17 00:00:00 2001 From: Jimmy-Blue <60958064+Jimmy-Blue@users.noreply.github.com> Date: Tue, 9 May 2023 13:30:37 +0700 Subject: [PATCH 4/4] style: black format --- exts/core/help.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/exts/core/help.py b/exts/core/help.py index 7ee221d..eeacaa5 100644 --- a/exts/core/help.py +++ b/exts/core/help.py @@ -45,11 +45,25 @@ async def help(self, ctx: interactions.SlashContext) -> None: ) embed.add_field( - name=f"/{command.name}" + (f" {command.group_name}" if str(command.group_name) != "None" else "") + (f" {command.sub_cmd_name}" if str(command.sub_cmd_name) != "None" else ""), - value=f"{command.sub_cmd_description}" if str(command.sub_cmd_name) != "None" else f"{command.description}" + name=f"/{command.name}" + + ( + f" {command.group_name}" + if str(command.group_name) != "None" + else "" + ) + + ( + f" {command.sub_cmd_name}" + if str(command.sub_cmd_name) != "None" + else "" + ), + value=f"{command.sub_cmd_description}" + if str(command.sub_cmd_name) != "None" + else f"{command.description}", ) i += 1 - paginator = Paginator.create_from_embeds(self.client, *help_list, timeout=30) + paginator = Paginator.create_from_embeds( + self.client, *help_list, timeout=30 + ) print(help_list) await paginator.send(ctx)