diff --git a/lib/src/main/java/net/tomatentum/marinara/registry/InteractionRegistry.java b/lib/src/main/java/net/tomatentum/marinara/registry/InteractionRegistry.java index 6f57965..a52d951 100644 --- a/lib/src/main/java/net/tomatentum/marinara/registry/InteractionRegistry.java +++ b/lib/src/main/java/net/tomatentum/marinara/registry/InteractionRegistry.java @@ -2,6 +2,7 @@ package net.tomatentum.marinara.registry; import java.lang.reflect.Method; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import java.util.Optional; @@ -45,7 +46,7 @@ public class InteractionRegistry { defs.add(new ApplicationCommandDefinition(def.applicationCommand()).addExecutableCommand(def)); }); - defs.forEach(wrapper::registerApplicationCommand); + wrapper.registerApplicationCommands(defs.toArray(new ApplicationCommandDefinition[0])); } public void handle(Object context) { diff --git a/lib/src/main/java/net/tomatentum/marinara/wrapper/LibraryWrapper.java b/lib/src/main/java/net/tomatentum/marinara/wrapper/LibraryWrapper.java index 6b3410c..cd3c5d3 100644 --- a/lib/src/main/java/net/tomatentum/marinara/wrapper/LibraryWrapper.java +++ b/lib/src/main/java/net/tomatentum/marinara/wrapper/LibraryWrapper.java @@ -17,7 +17,7 @@ public abstract class LibraryWrapper { interactionSubscriber = new ArrayList<>(); } - public abstract void registerApplicationCommand(ApplicationCommandDefinition def); + public abstract void registerApplicationCommands(ApplicationCommandDefinition[] defs); public void handleInteraction(Object context) { interactionSubscriber.forEach((o) -> o.accept(context));