added bean configuration for event waiter to be used for paginator

fixed initial setup for server
fixed command in a server configuration
This commit is contained in:
Sheldan
2020-05-10 20:29:32 +02:00
parent 82186c8757
commit ba032194ce
8 changed files with 72 additions and 11 deletions

View File

@@ -51,6 +51,9 @@ public class Warnings extends AbstractConditionableCommand {
@Autowired
private PaginatorService paginatorService;
@Autowired
private EventWaiter eventWaiter;
@Override
public CommandResult execute(CommandContext commandContext) {
List<Warning> warnsToDisplay;
@@ -65,7 +68,7 @@ public class Warnings extends AbstractConditionableCommand {
WarningsModel model = (WarningsModel) ContextConverter.fromCommandContext(commandContext, WarningsModel.class);
model.setWarnings(warnEntries);
Paginator paginator = paginatorService.createPaginatorFromTemplate("warnings_response", model, new EventWaiter());
Paginator paginator = paginatorService.createPaginatorFromTemplate("warnings_response", model, eventWaiter);
paginator.display(commandContext.getChannel());
return CommandResult.fromSuccess();
}