mirror of
https://github.com/Sheldan/OnePlusBot.git
synced 2026-01-01 15:28:28 +00:00
[OPB-xxx] updating abstracto version to 1.5.51
adapting templates to use the default locale
This commit is contained in:
@@ -66,14 +66,14 @@ public class FAQ extends AbstractConditionableCommand {
|
||||
.forEach(faqResponseMessageModel ->
|
||||
messageFutures.add(FutureUtils.
|
||||
toSingleFutureGeneric(channelService.
|
||||
sendEmbedTemplateInTextChannelList(FAQ_RESPONSE_TEMPLATE_KEY,
|
||||
sendEmbedTemplateInMessageChannel(FAQ_RESPONSE_TEMPLATE_KEY,
|
||||
faqResponseMessageModel, commandContext.getChannel()))));
|
||||
return FutureUtils.toSingleFutureGeneric(messageFutures);
|
||||
} else {
|
||||
return FutureUtils
|
||||
.toSingleFutureGeneric(
|
||||
channelService.
|
||||
sendEmbedTemplateInTextChannelList(FAQ_RESPONSE_NO_COMMAND_FOUND_TEMPLATE_KEY,
|
||||
sendEmbedTemplateInMessageChannel(FAQ_RESPONSE_NO_COMMAND_FOUND_TEMPLATE_KEY,
|
||||
faqResponseModel, commandContext.getChannel()));
|
||||
}
|
||||
})
|
||||
@@ -85,7 +85,7 @@ public class FAQ extends AbstractConditionableCommand {
|
||||
return FutureUtils
|
||||
.toSingleFutureGeneric(
|
||||
channelService.
|
||||
sendEmbedTemplateInTextChannelList(FAQ_RESPONSE_NO_COMMAND_FOUND_TEMPLATE_KEY,
|
||||
sendEmbedTemplateInMessageChannel(FAQ_RESPONSE_NO_COMMAND_FOUND_TEMPLATE_KEY,
|
||||
model, commandContext.getChannel()))
|
||||
.thenApply(unused -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class FAQUsage extends AbstractConditionableCommand {
|
||||
model = faqUsageServiceBean.getFAQUsageModel(server, commandName);
|
||||
}
|
||||
|
||||
return FutureUtils.toSingleFutureGeneric(channelService.sendEmbedTemplateInTextChannelList(FAQ_USAGE_RESPONSE_TEMPLATE_KEY, model, commandContext.getChannel()))
|
||||
return FutureUtils.toSingleFutureGeneric(channelService.sendEmbedTemplateInMessageChannel(FAQ_USAGE_RESPONSE_TEMPLATE_KEY, model, commandContext.getChannel()))
|
||||
.thenApply(unused -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ListFAQCommands extends AbstractConditionableCommand {
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
AServer server = serverManagementService.loadServer(commandContext.getGuild());
|
||||
ListFAQCommandsModel model = faqServiceBean.getCommandListingForServer(server);
|
||||
return FutureUtils.toSingleFutureGeneric(channelService.sendEmbedTemplateInTextChannelList(LIST_FAQ_COMMANDS_RESPONSE_TEMPLATE_KEY, model, commandContext.getChannel()))
|
||||
return FutureUtils.toSingleFutureGeneric(channelService.sendEmbedTemplateInMessageChannel(LIST_FAQ_COMMANDS_RESPONSE_TEMPLATE_KEY, model, commandContext.getChannel()))
|
||||
.thenApply(unused -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ public class ReferralListener implements AsyncMessageReceivedListener {
|
||||
.build();
|
||||
ServerUser serverUser = ServerUser.fromMember(message.getMember());
|
||||
CompletableFutureList<Message> sendFutures = new CompletableFutureList<>(channelService
|
||||
.sendEmbedTemplateInMessageChannelList(REFERRAL_POST_EMBED_TEMPLATE_KEY, postModel, message.getChannel()));
|
||||
.sendEmbedTemplateInMessageChannel(REFERRAL_POST_EMBED_TEMPLATE_KEY, postModel, message.getChannel()));
|
||||
CompletableFuture<Void> deletionFuture = messageService.deleteMessage(message);
|
||||
CompletableFuture.allOf(sendFutures.getMainFuture(), deletionFuture)
|
||||
.thenAccept(unused -> self.updateReferralStateInDatabase(serverUser))
|
||||
@@ -139,7 +139,7 @@ public class ReferralListener implements AsyncMessageReceivedListener {
|
||||
|
||||
private void deleteAndNotify(Message message, String usedTemplate, Object usedModel) {
|
||||
CompletableFutureList<Message> futures = new CompletableFutureList<>(channelService
|
||||
.sendEmbedTemplateInMessageChannelList(usedTemplate, usedModel, message.getChannel()));
|
||||
.sendEmbedTemplateInMessageChannel(usedTemplate, usedModel, message.getChannel()));
|
||||
futures.getMainFuture().thenAccept(unused ->
|
||||
scheduledExecutorService.schedule(() ->
|
||||
futures.getObjects().forEach(createdMessage -> messageService.deleteMessage(createdMessage)),
|
||||
|
||||
Reference in New Issue
Block a user