minor refactoring and addition of isRootCommand() to SlashCommandDefinition

This commit is contained in:
tueem 2024-10-29 19:51:37 +01:00
parent 19bf9d24bc
commit 1aa052a85b
No known key found for this signature in database
GPG Key ID: 819A0F7C36B9CF07

@ -40,20 +40,6 @@ public class SlashCommandDefinition {
return this;
}
public SlashCommand getSlashCommand() {
return slashCommand;
}
public ExecutableSlashCommandDefinition[] getExecutableDefinitons() {
return executableDefinitons.toArray(new ExecutableSlashCommandDefinition[0]);
}
public ExecutableSlashCommandDefinition[] getUniqueExecutableDefinitions() {
HashSet<ExecutableSlashCommandDefinition> set = new HashSet<>();
executableDefinitons.forEach(set::add);
return set.toArray(new ExecutableSlashCommandDefinition[0]);
}
public SubCommandGroup[] getSubCommandGroups() {
HashSet<SubCommandGroup> subCommandGroups = new HashSet<>();
@ -79,4 +65,22 @@ public class SlashCommandDefinition {
else
return (SubCommand[]) Arrays.asList(getUniqueExecutableDefinitions()).stream().filter((x) -> x.subCommandGroup().name().equals(group.name()) && x.subCommand() != null).toArray();
}
public SlashCommand getSlashCommand() {
return slashCommand;
}
public ExecutableSlashCommandDefinition[] getExecutableDefinitons() {
return executableDefinitons.toArray(new ExecutableSlashCommandDefinition[0]);
}
public ExecutableSlashCommandDefinition[] getUniqueExecutableDefinitions() {
HashSet<ExecutableSlashCommandDefinition> set = new HashSet<>();
executableDefinitons.forEach(set::add);
return set.toArray(new ExecutableSlashCommandDefinition[0]);
}
public boolean isRootCommand() {
return isRootCommand;
}
}