mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-13 19:41:38 +00:00
[AB-218] adding ability to split the normal message as well according to custom configuration
adding ability to define the max amount of messages resulting from a template on a server and template base fixing not always considering the server when rendering templates in various places
This commit is contained in:
@@ -242,7 +242,7 @@ public class WarnServiceBean implements WarnService {
|
||||
.guild(guildService.getGuildById(server.getId()))
|
||||
.warnings(warnDecayWarnings)
|
||||
.build();
|
||||
MessageToSend messageToSend = templateService.renderEmbedTemplate(WARN_DECAY_LOG_TEMPLATE_KEY, warnDecayLogModel);
|
||||
MessageToSend messageToSend = templateService.renderEmbedTemplate(WARN_DECAY_LOG_TEMPLATE_KEY, warnDecayLogModel, serverId);
|
||||
List<CompletableFuture<Message>> messageFutures = postTargetService.sendEmbedInPostTarget(messageToSend, WarnDecayPostTarget.DECAY_LOG, server.getId());
|
||||
return FutureUtils.toSingleFutureGeneric(messageFutures);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,6 @@ public class MessageEditedListenerTest {
|
||||
|
||||
private static final Long SERVER_ID = 4L;
|
||||
private static final Long CHANNEL_ID = 5L;
|
||||
private static final Long AUTHOR_ID = 6L;
|
||||
|
||||
@Test
|
||||
public void testExecuteListenerWithSameContent() {
|
||||
@@ -66,7 +65,7 @@ public class MessageEditedListenerTest {
|
||||
when(model.getAfter()).thenReturn(messageAfter);
|
||||
when(model.getBefore()).thenReturn(messageBefore);
|
||||
testUnit.execute(model);
|
||||
verify(templateService, times(0)).renderEmbedTemplate(eq(MessageEditedListener.MESSAGE_EDITED_TEMPLATE), any());
|
||||
verify(templateService, times(0)).renderEmbedTemplate(eq(MessageEditedListener.MESSAGE_EDITED_TEMPLATE), any(), eq(SERVER_ID));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -62,7 +62,7 @@ public class BanServiceBeanTest {
|
||||
testUnit.banMember(memberToBan, REASON, context);
|
||||
verify(mockedGuild, times(1)).ban(USER_ID.toString(), 0, REASON);
|
||||
verify(postTargetService, times(0)).sendEmbedInPostTarget(mockedMessage, ModerationPostTarget.BAN_LOG, SERVER_ID);
|
||||
verify(templateService, times(0)).renderEmbedTemplate(BanServiceBean.BAN_LOG_TEMPLATE, context);
|
||||
verify(templateService, times(0)).renderEmbedTemplate(BanServiceBean.BAN_LOG_TEMPLATE, context, SERVER_ID);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user