From 92a003ca6fc1939cb9dcb1e944c391ca2219bb27 Mon Sep 17 00:00:00 2001 From: TheCodedProf Date: Wed, 25 Jan 2023 18:01:21 -0500 Subject: [PATCH] slight modification to help --- src/commands/help.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/commands/help.ts b/src/commands/help.ts index 1a0ce16..26d86c5 100644 --- a/src/commands/help.ts +++ b/src/commands/help.ts @@ -53,10 +53,12 @@ const callback = async (interaction: CommandInteraction): Promise => { `**${current.name}**\n\n` + `${current.description}` ) - if(current.options.filter((option) => option.type === ApplicationCommandOptionType.SubcommandGroup).length > 0) { + const subcommands = current.options.filter((option) => option.type === ApplicationCommandOptionType.Subcommand); + const subcommandGroups = current.options.filter((option) => option.type === ApplicationCommandOptionType.SubcommandGroup); + if(subcommandGroups.length > 0) { subcommandGroupRow.components[0]! .addOptions( - current.options.filter((option) => option.type === ApplicationCommandOptionType.SubcommandGroup).map((option) => { + subcommandGroups.map((option) => { return { label: option.name, value: option.name @@ -64,10 +66,10 @@ const callback = async (interaction: CommandInteraction): Promise => { }) ) } else { - if(current.options.filter((option) => option.type === ApplicationCommandOptionType.Subcommand).length > 0) { + if(subcommands.length > 0) { subcommandRow.components[0]! .addOptions( - current.options.filter((option) => option.type === ApplicationCommandOptionType.Subcommand).map((option) => { + subcommands.map((option) => { return { label: option.name, value: option.name