added reminders command

fixed embedbuilder list not containing an initial embed builder
This commit is contained in:
Sheldan
2020-04-08 16:22:58 +02:00
parent c30d7aab92
commit ef8dcb61d9
9 changed files with 119 additions and 6 deletions

View File

@@ -44,6 +44,7 @@ public class TemplateServiceBean implements TemplateService {
public MessageToSend renderEmbedTemplate(String key, Object model) {
String embedConfig = this.renderTemplate(key + "_embed", model);
List<EmbedBuilder> embedBuilders = new ArrayList<>();
embedBuilders.add(new EmbedBuilder());
EmbedConfiguration configuration = gson.fromJson(embedConfig, EmbedConfiguration.class);
String description = configuration.getDescription();
if(description != null) {
@@ -116,8 +117,8 @@ public class TemplateServiceBean implements TemplateService {
return FreeMarkerTemplateUtils.processTemplateIntoString(configuration.getTemplate(key), parameters);
} catch (IOException | TemplateException e) {
log.warn("Failed to render template. ", e);
throw new RuntimeException(e);
}
return "";
}
@Override
@@ -126,7 +127,7 @@ public class TemplateServiceBean implements TemplateService {
return FreeMarkerTemplateUtils.processTemplateIntoString(configuration.getTemplate(key), model);
} catch (IOException | TemplateException e) {
log.warn("Failed to render template. ", e);
return null;
throw new RuntimeException(e);
}
}
}