[AB-xxx] using the suggestion message as the thread starter for suggestion threads

This commit is contained in:
Sheldan
2024-06-03 22:24:35 +02:00
parent 2fa1adde02
commit b6a188c04d
3 changed files with 28 additions and 6 deletions

View File

@@ -18,6 +18,7 @@ import lombok.extern.slf4j.Slf4j;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.Permission;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.entities.channel.attribute.IThreadContainer;
import net.dv8tion.jda.api.entities.channel.concrete.Category;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import net.dv8tion.jda.api.entities.channel.concrete.ThreadChannel;
@@ -116,6 +117,16 @@ public class ChannelServiceBean implements ChannelService {
sendTextToChannel(text, channel);
}
@Override
public CompletableFuture<ThreadChannel> createThreadChannel(IThreadContainer threadContainer, String name) {
return threadContainer.createThreadChannel(name).submit();
}
@Override
public CompletableFuture<ThreadChannel> createThreadChannel(IThreadContainer threadContainer, String name, Long messageId) {
return threadContainer.createThreadChannel(name, messageId).submit();
}
@Override
public CompletableFuture<Message> sendTextToAChannel(String text, AChannel channel) {
GuildMessageChannel guildMessageChannel = getGuildMessageChannelFromAChannel(channel);

View File

@@ -5,6 +5,7 @@ import dev.sheldan.abstracto.core.models.database.AServer;
import dev.sheldan.abstracto.core.templating.model.MessageToSend;
import net.dv8tion.jda.api.Permission;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.entities.channel.attribute.IThreadContainer;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import net.dv8tion.jda.api.entities.channel.concrete.ThreadChannel;
import net.dv8tion.jda.api.entities.channel.middleman.GuildChannel;
@@ -20,6 +21,8 @@ import java.util.concurrent.CompletableFuture;
public interface ChannelService {
void sendTextToAChannelNotAsync(String text, AChannel channel);
void sendTextToChannelNotAsync(String text, MessageChannel channel);
CompletableFuture<ThreadChannel> createThreadChannel(IThreadContainer threadContainer, String name);
CompletableFuture<ThreadChannel> createThreadChannel(IThreadContainer threadContainer, String name, Long messageId);
CompletableFuture<Message> sendTextToAChannel(String text, AChannel channel);
CompletableFuture<Message> sendMessageToAChannel(Message message, AChannel channel);
CompletableFuture<Message> sendMessageToChannel(Message message, GuildMessageChannel channel);