mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-04 00:36:26 +00:00
[AB-xxx] enabling localization by adding the localization as a system config key
fixing methods which did not provide the server id to template rendering refactoring channel service method to remove a duplicate fixing template loading method to not throw an exception when template was not found
This commit is contained in:
@@ -69,7 +69,7 @@ public class RepostLeaderboard extends AbstractConditionableCommand {
|
||||
.userExecuting(userFuture.join())
|
||||
.member(commandContext.getAuthor())
|
||||
.build();
|
||||
return FutureUtils.toSingleFutureGeneric(channelService.sendEmbedTemplateInTextChannelList(REPOST_LEADERBOARD_RESPONSE_TEMPLATE_KEY, model, commandContext.getChannel()));
|
||||
return FutureUtils.toSingleFutureGeneric(channelService.sendEmbedTemplateInMessageChannel(REPOST_LEADERBOARD_RESPONSE_TEMPLATE_KEY, model, commandContext.getChannel()));
|
||||
}).thenApply(o -> CommandResult.fromIgnored());
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ShowRepostCheckChannels extends AbstractConditionableCommand {
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
List<RepostCheckChannelGroup> channelGroups = checkChannelService.getChannelGroupsWithEnabledCheck(commandContext.getGuild().getIdLong());
|
||||
RepostCheckChannelsModel model = converter.fromRepostCheckChannelGroups(channelGroups, commandContext.getGuild());
|
||||
return FutureUtils.toSingleFutureGeneric(channelService.sendEmbedTemplateInTextChannelList(SHOW_REPOST_CHECK_CHANNELS_RESPONSE_TEMPLATE_KEY, model, commandContext.getChannel()))
|
||||
return FutureUtils.toSingleFutureGeneric(channelService.sendEmbedTemplateInMessageChannel(SHOW_REPOST_CHECK_CHANNELS_RESPONSE_TEMPLATE_KEY, model, commandContext.getChannel()))
|
||||
.thenApply(unused -> CommandResult.fromIgnored());
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ public class RepostLeaderboardTest {
|
||||
when(converter.convertSingleUser(userResult)).thenReturn(CompletableFuture.completedFuture(convertedUserResult));
|
||||
CompletableFuture<CommandResult> resultFuture = testUnit.executeAsync(noParameters);
|
||||
CommandTestUtilities.checkSuccessfulCompletionAsync(resultFuture);
|
||||
verify(channelService, times(1)).sendEmbedTemplateInTextChannelList(eq(RepostLeaderboard.REPOST_LEADERBOARD_RESPONSE_TEMPLATE_KEY), modelCaptor.capture(), eq(noParameters.getChannel()));
|
||||
verify(channelService, times(1)).sendEmbedTemplateInMessageChannel(eq(RepostLeaderboard.REPOST_LEADERBOARD_RESPONSE_TEMPLATE_KEY), modelCaptor.capture(), eq(noParameters.getChannel()));
|
||||
RepostLeaderboardModel model = modelCaptor.getValue();
|
||||
Assert.assertEquals(noParameters.getGuild(), model.getGuild());
|
||||
Assert.assertEquals(convertedList, model.getEntries());
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ShowRepostCheckChannelsTest {
|
||||
when(converter.fromRepostCheckChannelGroups(groupList, noParameters.getGuild())).thenReturn(model);
|
||||
CompletableFuture<CommandResult> futureResult = testUnit.executeAsync(noParameters);
|
||||
CommandTestUtilities.checkSuccessfulCompletionAsync(futureResult);
|
||||
verify(channelService, times(1)).sendEmbedTemplateInTextChannelList(ShowRepostCheckChannels.SHOW_REPOST_CHECK_CHANNELS_RESPONSE_TEMPLATE_KEY, model, noParameters.getChannel());
|
||||
verify(channelService, times(1)).sendEmbedTemplateInMessageChannel(ShowRepostCheckChannels.SHOW_REPOST_CHECK_CHANNELS_RESPONSE_TEMPLATE_KEY, model, noParameters.getChannel());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user