mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-03 16:34:09 +00:00
added template support to echo
replaced HashMaps for templates with concrete models, so the interface is easier known added rendering method for objects directly added default parameters available for commands split up service beans for server/channel into management and service bean added server reference in AChannel refactored join/leave listener
This commit is contained in:
@@ -35,6 +35,12 @@
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.sheldan.abstracto.core</groupId>
|
||||
<artifactId>core-interface</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package dev.sheldan.abstracto.command;
|
||||
|
||||
import dev.sheldan.abstracto.command.execution.Configuration;
|
||||
import dev.sheldan.abstracto.command.execution.Context;
|
||||
import dev.sheldan.abstracto.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.command.execution.Result;
|
||||
|
||||
public interface Command<T> {
|
||||
|
||||
Result execute(Context context);
|
||||
Result execute(CommandContext commandContext);
|
||||
Configuration getConfiguration();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package dev.sheldan.abstracto.command;
|
||||
|
||||
import dev.sheldan.abstracto.command.execution.Context;
|
||||
import dev.sheldan.abstracto.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.command.execution.Result;
|
||||
|
||||
public interface PostCommandExecution {
|
||||
void execute(Context context, Result result, Command command);
|
||||
void execute(CommandContext commandContext, Result result, Command command);
|
||||
}
|
||||
|
||||
@@ -10,11 +10,12 @@ import net.dv8tion.jda.api.entities.User;
|
||||
|
||||
@Builder
|
||||
@Getter
|
||||
public class Context {
|
||||
public class CommandContext {
|
||||
private TextChannel channel;
|
||||
private Guild guild;
|
||||
private User author;
|
||||
private Message message;
|
||||
private CommandTemplateContext commandTemplateContext;
|
||||
private Parameters parameters;
|
||||
private JDA jda;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package dev.sheldan.abstracto.command.execution;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.AChannel;
|
||||
import dev.sheldan.abstracto.core.models.AServer;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter @Builder @AllArgsConstructor
|
||||
public class CommandTemplateContext {
|
||||
private AChannel channel;
|
||||
private AServer server;
|
||||
|
||||
public CommandTemplateContext(CommandTemplateContext commandTemplateContext) {
|
||||
this.channel = commandTemplateContext.channel;
|
||||
this.server = commandTemplateContext.server;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user