mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-06 01:10:58 +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:
@@ -11,8 +11,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Service
|
||||
@@ -23,10 +21,10 @@ public class Help implements Command {
|
||||
private ModuleRegistry registry;
|
||||
|
||||
@Override
|
||||
public Result execute(Context context) {
|
||||
public Result execute(CommandContext commandContext) {
|
||||
CommandHierarchy commandStructure = registry.getDetailedModules();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if(context.getParameters().getParameters().isEmpty()){
|
||||
if(commandContext.getParameters().getParameters().isEmpty()){
|
||||
sb.append("Help | Module overview \n");
|
||||
sb.append("```");
|
||||
commandStructure.getRootModules().forEach(packedModule -> {
|
||||
@@ -35,7 +33,7 @@ public class Help implements Command {
|
||||
});
|
||||
sb.append("```");
|
||||
} else {
|
||||
String parameterValue = context.getParameters().getParameters().get(0).toString();
|
||||
String parameterValue = commandContext.getParameters().getParameters().get(0).toString();
|
||||
PackedModule module = commandStructure.getModuleWithName(parameterValue);
|
||||
if(module != null){
|
||||
sb.append("Help | Module overview \n");
|
||||
@@ -53,7 +51,7 @@ public class Help implements Command {
|
||||
}
|
||||
}
|
||||
|
||||
context.getChannel().sendMessage(sb.toString()).queue();
|
||||
commandContext.getChannel().sendMessage(sb.toString()).queue();
|
||||
return Result.fromSuccess();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user