diff --git a/src/class/Util.ts b/src/class/Util.ts index 279f6a9..b1b9b99 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -66,10 +66,14 @@ export default class Util { parentLabel += `${resolvedCommand.name} `; resolvedCommand = resolvedCommand.subcommands.get(args[0]); args.shift(); } else { - for (const subCmd of resolvedCommand.subcommands.toArray()) { + const subcommandArray = resolvedCommand.subcommands.toArray(); + for (const subCmd of subcommandArray) { if (subCmd.aliases.includes(args[0])) { parentLabel += `${resolvedCommand.name} `; resolvedCommand = subCmd; args.shift(); break; } + if (subcommandArray.findIndex((v) => v === subCmd) === subcommandArray.length - 1) { + hasSubCommands = false; break; + } } } }