added purge command to delete messages via bulk delete

adapted api of status message service
added concept of self destruct command results, these will cause the command message to be deleted
This commit is contained in:
Sheldan
2020-06-03 19:22:31 +02:00
parent 072072dffc
commit 1091e66013
23 changed files with 361 additions and 1 deletions

View File

@@ -114,6 +114,11 @@ public class TemplateServiceBean implements TemplateService {
.build();
}
@Override
public MessageToSend renderTemplateToMessageToSend(String key, Object model) {
return MessageToSend.builder().message(renderTemplate(key, model)).build();
}
private void createFieldsForEmbed(List<EmbedBuilder> embedBuilders, EmbedConfiguration configuration) {
for (int i = 0; i < configuration.getFields().size(); i++) {
EmbedField field = configuration.getFields().get(i);

View File

@@ -18,6 +18,14 @@ public interface TemplateService {
*/
MessageToSend renderEmbedTemplate(String key, Object model);
/**
* Renders the given template directly into a {@link MessageToSend} but the template only represents a text message.
* @param key The key of the string template to be rendered.
* @param model The model used to render the template
* @return A {@link MessageToSend} instance only containing the string property.
*/
MessageToSend renderTemplateToMessageToSend(String key, Object model);
/**
* Renders the template identified by the key with the given {@link HashMap} used as model and returns the value as a string
* @param key The key of the template to be rendered.