fix base getSubCommands method

This commit is contained in:
Tueem 2025-03-03 23:32:07 +01:00
parent 91b1df8d5b
commit 823402e0cd
Signed by: tueem
GPG Key ID: F2CE0513D231AD7A

View File

@ -72,7 +72,7 @@ public class SlashCommandDefinition {
public SlashCommandIdentifier[] getSubCommands() { public SlashCommandIdentifier[] getSubCommands() {
if (isRootCommand) if (isRootCommand)
return null; return null;
return InteractionIdentifier.distinct(entries.stream().toList()).toArray(SlashCommandIdentifier[]::new); return InteractionIdentifier.distinct(entries.stream().filter(x -> x instanceof RootCommandIdentifier).toList()).toArray(SlashCommandIdentifier[]::new);
} }
public SlashCommandIdentifier[] getSubCommands(String groupName) { public SlashCommandIdentifier[] getSubCommands(String groupName) {