use of org.finos.symphony.toolkit.workflow.response.MessageResponse in project spring-bot by finos.
the class ReminderController method timezones.
@ChatRequest(value = "timezones", description = "List Time Zones")
public Response timezones(Addressable a) {
Map<String, List<String>> zoneMap = ZoneId.getAvailableZoneIds().stream().sorted().collect(Collectors.groupingBy(k -> {
int slashIndex = k.indexOf("/");
if (slashIndex == -1) {
return "none";
} else {
return k.substring(0, slashIndex);
}
}));
List<? extends Content> headers = Word.build("Region Zone");
List<List<? extends Content>> tableCells = zoneMap.keySet().stream().map(m -> Arrays.asList(Word.of(m), bulletsOf(zoneMap.get(m)))).collect(Collectors.toList());
Table t = Table.of(headers, tableCells);
return new MessageResponse(a, t);
}
Aggregations