minor refactoring and addition of isRootCommand() to SlashCommandDefinition
This commit is contained in:
parent
19bf9d24bc
commit
1aa052a85b
@ -40,20 +40,6 @@ public class SlashCommandDefinition {
|
|||||||
return this;
|
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() {
|
public SubCommandGroup[] getSubCommandGroups() {
|
||||||
HashSet<SubCommandGroup> subCommandGroups = new HashSet<>();
|
HashSet<SubCommandGroup> subCommandGroups = new HashSet<>();
|
||||||
|
|
||||||
@ -79,4 +65,22 @@ public class SlashCommandDefinition {
|
|||||||
else
|
else
|
||||||
return (SubCommand[]) Arrays.asList(getUniqueExecutableDefinitions()).stream().filter((x) -> x.subCommandGroup().name().equals(group.name()) && x.subCommand() != null).toArray();
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user