create seperate class for ContextObjectProviders and renamed some context parameters from parameter to context.
First parts of AutocompleteInteraction added
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package net.tomatentum.marinara.wrapper;
|
||||
|
||||
public interface ContextObjectProvider {
|
||||
|
||||
public Object convertCommandOption(Object context, String optionName);
|
||||
|
||||
public Object getComponentContextObject(Object context, Class<?> type);
|
||||
public Object getInteractionContextObject(Object context, Class<?> type);
|
||||
|
||||
public Object getAutocompleteFocusedOption(Object context);
|
||||
}
|
@@ -6,7 +6,6 @@ import java.util.function.Consumer;
|
||||
|
||||
import net.tomatentum.marinara.interaction.commands.SlashCommandDefinition;
|
||||
import net.tomatentum.marinara.interaction.commands.ExecutableSlashCommandDefinition;
|
||||
import net.tomatentum.marinara.interaction.commands.option.SlashCommandOptionType;
|
||||
import net.tomatentum.marinara.interaction.InteractionType;
|
||||
|
||||
public abstract class LibraryWrapper {
|
||||
@@ -17,7 +16,6 @@ public abstract class LibraryWrapper {
|
||||
interactionSubscriber = new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
public void handleInteraction(Object context) {
|
||||
interactionSubscriber.forEach((o) -> o.accept(context));
|
||||
}
|
||||
@@ -32,9 +30,10 @@ public abstract class LibraryWrapper {
|
||||
public abstract InteractionType getInteractionType(Class<?> clazz);
|
||||
|
||||
public abstract void registerSlashCommands(SlashCommandDefinition[] defs);
|
||||
public abstract Object convertCommandOption(Object context, SlashCommandOptionType type, String optionName);
|
||||
public abstract ExecutableSlashCommandDefinition getCommandDefinition(Object context);
|
||||
|
||||
public abstract String getButtonId(Object context);
|
||||
public abstract Object getComponentContextObject(Object context, Class<?> type);
|
||||
|
||||
public abstract ContextObjectProvider getContextObjectProvider();
|
||||
|
||||
}
|
Reference in New Issue
Block a user