added embed support fo message deleted and message edited

added attachment support for message deleted
added imageUrl support to embed templating
This commit is contained in:
Sheldan
2020-03-20 21:20:14 +01:00
parent ff29edbdac
commit d3a9a7a9f0
13 changed files with 102 additions and 10 deletions

View File

@@ -12,6 +12,7 @@ public class EmbedConfiguration {
private EmbedColor color;
private String description;
private String thumbnail;
private String imageUrl;
private List<EmbedField> fields;
private EmbedFooter footer;
}

View File

@@ -76,10 +76,14 @@ public class TemplateServiceBean implements TemplateService {
if(footer != null) {
builder.setFooter(footer.getText(), footer.getIcon());
}
configuration.getFields().forEach(embedField -> {
Boolean inline = embedField.getInline() != null ? embedField.getInline() : Boolean.FALSE;
builder.addField(embedField.getName(), embedField.getValue(), inline);
});
if(configuration.getFields() != null) {
configuration.getFields().forEach(embedField -> {
Boolean inline = embedField.getInline() != null ? embedField.getInline() : Boolean.FALSE;
builder.addField(embedField.getName(), embedField.getValue(), inline);
});
}
builder.setImage(configuration.getImageUrl());
EmbedColor color = configuration.getColor();
if(color != null) {