Compare commits

..

2 Commits

Author SHA1 Message Date
3e50a065a3
add wrapper register execution 2024-10-15 17:43:23 +02:00
b562349cae
merge Global and Server register methods into one 2024-10-15 17:43:07 +02:00
2 changed files with 3 additions and 2 deletions

View File

@ -44,6 +44,8 @@ public class InteractionRegistry {
else else
defs.add(new ApplicationCommandDefinition(def.applicationCommand()).addExecutableCommand(def)); defs.add(new ApplicationCommandDefinition(def.applicationCommand()).addExecutableCommand(def));
}); });
defs.forEach(wrapper::registerApplicationCommand);
} }
public void handle(Object context) { public void handle(Object context) {

View File

@ -17,8 +17,7 @@ public abstract class LibraryWrapper {
interactionSubscriber = new ArrayList<>(); interactionSubscriber = new ArrayList<>();
} }
public abstract void registerGlobalCommand(ApplicationCommandDefinition def); public abstract void registerApplicationCommand(ApplicationCommandDefinition def);
public abstract void registerServerCommand(ApplicationCommandDefinition def);
public void handleInteraction(Object context) { public void handleInteraction(Object context) {
interactionSubscriber.forEach((o) -> o.accept(context)); interactionSubscriber.forEach((o) -> o.accept(context));