diff --git a/lib/src/main/java/net/tomatentum/marinara/interaction/commands/ApplicationCommandDefinition.java b/lib/src/main/java/net/tomatentum/marinara/interaction/commands/ApplicationCommandDefinition.java index ac87f27..ea1627f 100644 --- a/lib/src/main/java/net/tomatentum/marinara/interaction/commands/ApplicationCommandDefinition.java +++ b/lib/src/main/java/net/tomatentum/marinara/interaction/commands/ApplicationCommandDefinition.java @@ -1,6 +1,7 @@ package net.tomatentum.marinara.interaction.commands; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import net.tomatentum.marinara.interaction.commands.annotation.ApplicationCommand; @@ -45,10 +46,15 @@ public class ApplicationCommandDefinition { return applicationCommand; } - public List getExecutableDefinitons() { - return executableDefinitons; + public ExecutableCommandDefinition[] getExecutableDefinitons() { + return executableDefinitons.toArray(new ExecutableCommandDefinition[0]); } + public ExecutableCommandDefinition[] getUniqueExecutableDefinitions() { + HashSet set = new HashSet<>(); + executableDefinitons.forEach(set::add); + return set.toArray(new ExecutableCommandDefinition[0]); + } public int getSubCommandGroupCount() { return subCommandGroupCount; }