Compare commits
No commits in common. "3db51e9c0bfc6f2b5450e173536528f7a215601a" and "fff20c8dab9380514d85ec15f9bae5c6f061caef" have entirely different histories.
3db51e9c0b
...
fff20c8dab
@ -1,28 +1,5 @@
|
|||||||
package net.tomatentum.marinara.command;
|
package net.tomatentum.marinara.command;
|
||||||
|
|
||||||
import net.tomatentum.marinara.handler.InteractionHandler;
|
public class DiscordCommand {
|
||||||
|
|
||||||
public abstract class DiscordCommand implements InteractionHandler {
|
|
||||||
private String name;
|
|
||||||
private String description;
|
|
||||||
private String[] aliases;
|
|
||||||
|
|
||||||
protected DiscordCommand(String name, String description, String... aliases) {
|
|
||||||
this.name = name;
|
|
||||||
this.description = description;
|
|
||||||
this.aliases = aliases;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String[] getAliases() {
|
|
||||||
return aliases;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
package net.tomatentum.marinara.command;
|
|
||||||
|
|
||||||
public class GlobalDiscordCommand extends DiscordCommand{
|
|
||||||
private boolean enabledInDms = false;
|
|
||||||
|
|
||||||
public GlobalDiscordCommand(String name, String description, String... aliases) {
|
|
||||||
super(name, description, aliases);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isEnabledInDms() {
|
|
||||||
return enabledInDms;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnabledInDms(boolean enabledInDms) {
|
|
||||||
this.enabledInDms = enabledInDms;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
package net.tomatentum.marinara.command;
|
|
||||||
|
|
||||||
public class ServerDiscordCommand extends DiscordCommand {
|
|
||||||
private long[] servers;
|
|
||||||
|
|
||||||
public ServerDiscordCommand(String name, String description, String... aliases) {
|
|
||||||
super(name, description, aliases);
|
|
||||||
}
|
|
||||||
|
|
||||||
public long[] getServers() {
|
|
||||||
return servers;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
package net.tomatentum.marinara.command.annotation;
|
|
||||||
|
|
||||||
import net.tomatentum.marinara.command.option.OptionType;
|
|
||||||
|
|
||||||
public @interface CommandOption {
|
|
||||||
public String name();
|
|
||||||
public String description() default "";
|
|
||||||
public OptionType type() default OptionType.STRING;
|
|
||||||
public boolean required() default false;
|
|
||||||
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
package net.tomatentum.marinara.command.annotation;
|
|
||||||
|
|
||||||
public @interface RootCommand {
|
|
||||||
public String name();
|
|
||||||
public String description() default "";
|
|
||||||
public CommandOption[] options() default {};
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
package net.tomatentum.marinara.command.annotation;
|
|
||||||
|
|
||||||
public @interface SubCommand {
|
|
||||||
public String name();
|
|
||||||
public String description() default "";
|
|
||||||
public CommandOption[] options() default {};
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
package net.tomatentum.marinara.command.annotation;
|
|
||||||
|
|
||||||
public @interface SubCommandGroup {
|
|
||||||
public String name();
|
|
||||||
public String description() default "";
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
package net.tomatentum.marinara.command.option;
|
|
||||||
|
|
||||||
public enum OptionType {
|
|
||||||
ATTACHMENT,
|
|
||||||
BOOLEAN,
|
|
||||||
CHANNEL,
|
|
||||||
DECIMAL,
|
|
||||||
LONG,
|
|
||||||
MENTIONABLE,
|
|
||||||
ROLE,
|
|
||||||
STRING,
|
|
||||||
SUB_COMMAND,
|
|
||||||
SUB_COMMAND_GROUP,
|
|
||||||
UNKNOW,
|
|
||||||
USER
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
package net.tomatentum.marinara.handler;
|
|
||||||
|
|
||||||
public interface InteractionHandler {
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
package net.tomatentum.marinara.interaction;
|
|
||||||
|
|
||||||
public enum InteractionType {
|
|
||||||
COMMAND,
|
|
||||||
AUTOCOMPLETE,
|
|
||||||
BUTTON,
|
|
||||||
SELECT_MENU,
|
|
||||||
MODAL
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
package net.tomatentum.marinara.wrapper;
|
|
||||||
|
|
||||||
public interface LibraryConverter {
|
|
||||||
public Object toAttachment(Object context, String option);
|
|
||||||
public Object toChannel(Object context, String option);
|
|
||||||
public Object toMentionable(Object context, String option);
|
|
||||||
public Object toRole(Object context, String option);
|
|
||||||
public Object toUser(Object context, String option);
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
package net.tomatentum.marinara.wrapper;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
import net.tomatentum.marinara.command.option.OptionType;
|
|
||||||
import net.tomatentum.marinara.interaction.InteractionType;
|
|
||||||
|
|
||||||
public abstract class LibraryWrapper {
|
|
||||||
|
|
||||||
private List<Consumer<Object>> interactionSubscriber;
|
|
||||||
|
|
||||||
protected LibraryWrapper() {
|
|
||||||
interactionSubscriber = new ArrayList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract void registerGlobalCommand();
|
|
||||||
public abstract void registerServerCommand();
|
|
||||||
|
|
||||||
public void handleInteraction(Object context) {
|
|
||||||
interactionSubscriber.forEach((o) -> o.accept(context));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void subscribeInteractions(Consumer<Object> consumer) {
|
|
||||||
interactionSubscriber.add(consumer);
|
|
||||||
}
|
|
||||||
public void unsubscribeInteractions(Consumer<Object> consumer) {
|
|
||||||
interactionSubscriber.remove(consumer);
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract InteractionType getInteractionType(Class<?> clazz);
|
|
||||||
public abstract OptionType getOptionType(Class<?> clazz);
|
|
||||||
public abstract LibraryConverter getConverter();
|
|
||||||
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user