refactored the naming in channel service

added initial version of closing and logging the thread
This commit is contained in:
Sheldan
2020-05-06 18:32:08 +02:00
parent 54327c3e58
commit ad1cbb54fd
37 changed files with 392 additions and 64 deletions

View File

@@ -13,17 +13,21 @@ import java.util.Optional;
import java.util.concurrent.CompletableFuture;
public interface ChannelService {
void sendTextInAChannel(String text, AChannel channel);
void sendTextInAChannel(String text, MessageChannel channel);
CompletableFuture<Message> sendTextInAChannelFuture(String text, AChannel channel);
CompletableFuture<Message> sendTextInAChannelFuture(String text, MessageChannel channel);
CompletableFuture<Message> sendEmbedInAChannelFuture(MessageEmbed embed, AChannel channel);
CompletableFuture<Message> sendEmbedInAChannelFuture(MessageEmbed embed, MessageChannel channel);
List<CompletableFuture<Message>> sendMessageToEndInAChannel(MessageToSend messageToSend, AChannel channel);
List<CompletableFuture<Message>> sendMessageToEndInTextChannel(MessageToSend messageToSend, MessageChannel textChannel);
void sendTextToAChannelNoFuture(String text, AChannel channel);
void sendTextToChannelNoFuture(String text, MessageChannel channel);
CompletableFuture<Message> sendTextToAChannel(String text, AChannel channel);
CompletableFuture<Message> sendMessageToAChannel(Message message, AChannel channel);
CompletableFuture<Message> sendMessageToChannel(Message message, MessageChannel channel);
CompletableFuture<Message> sendTextToChannel(String text, MessageChannel channel);
CompletableFuture<Message> sendEmbedToAChannel(MessageEmbed embed, AChannel channel);
CompletableFuture<Message> sendEmbedToChannel(MessageEmbed embed, MessageChannel channel);
List<CompletableFuture<Message>> sendMessageToSendToAChannel(MessageToSend messageToSend, AChannel channel);
List<CompletableFuture<Message>> sendMessageToSendToChannel(MessageToSend messageToSend, MessageChannel textChannel);
Optional<TextChannel> getTextChannelInGuild(Long serverId, Long channelId);
void editMessageInAChannel(MessageToSend messageToSend, AChannel channel, Long messageId);
void editMessageInAChannel(MessageToSend messageToSend, MessageChannel channel, Long messageId);
CompletableFuture<Void> deleteTextChannel(AChannel channel);
List<CompletableFuture<Message>> sendTemplateInChannel(String templateKey, Object model, MessageChannel channel);
CompletableFuture<TextChannel> createTextChannel(String name, AServer server, Long categoryId);
}

View File

@@ -5,6 +5,7 @@ import dev.sheldan.abstracto.core.models.cache.CachedReaction;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.MessageReaction;
import java.util.List;
import java.util.concurrent.CompletableFuture;
public interface MessageCache {

View File

@@ -1,5 +1,6 @@
package dev.sheldan.abstracto.core.service;
import dev.sheldan.abstracto.core.models.ServerChannelMessage;
import dev.sheldan.abstracto.core.models.database.AChannel;
import dev.sheldan.abstracto.core.models.database.AUserInAServer;
import dev.sheldan.abstracto.templating.model.MessageToSend;
@@ -7,6 +8,7 @@ import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.User;
import java.util.List;
import java.util.concurrent.CompletableFuture;
public interface MessageService {

View File

@@ -13,6 +13,8 @@ public interface PostTargetService {
CompletableFuture<Message> sendEmbedInPostTarget(MessageEmbed embed, PostTarget target);
CompletableFuture<Message> sendTextInPostTarget(String text, String postTargetName, Long serverId);
CompletableFuture<Message> sendEmbedInPostTarget(MessageEmbed embed, String postTargetName, Long serverId);
CompletableFuture<Message> sendMessageInPostTarget(Message message, String postTargetName, Long serverId);
CompletableFuture<Message> sendMessageInPostTarget(Message message, PostTarget target);
List<CompletableFuture<Message>> sendEmbedInPostTarget(MessageToSend message, String postTargetName, Long serverId);
List<CompletableFuture<Message>> sendEmbedInPostTarget(MessageToSend message, PostTarget target);
List<CompletableFuture<Message>> editEmbedInPostTarget(Long messageId, MessageToSend message, PostTarget target);