forked from SteamWar/SteamWar
Check why StaticMessageChannel does not work?
This commit is contained in:
@@ -159,7 +159,6 @@ public class DiscordBot {
|
||||
if (!list.isEmpty()) {
|
||||
actionRows.add(ActionRow.of(list.toArray(Button[]::new)));
|
||||
}
|
||||
System.out.println("Initializing Ticket channel");
|
||||
new StaticMessageChannel(config.channel("ticket"), () -> new MessageCreateBuilder()
|
||||
.setEmbeds(new EmbedBuilder()
|
||||
.setDescription("Hier kannst du Tickets öffnen, welche nur von dir und Teammitgliedern eingesehen werden können.")
|
||||
|
||||
+2
-2
@@ -27,6 +27,7 @@ import net.dv8tion.jda.api.events.interaction.component.GenericComponentInteract
|
||||
import net.dv8tion.jda.api.utils.messages.MessageCreateBuilder;
|
||||
import net.dv8tion.jda.api.utils.messages.MessageEditData;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
@@ -62,9 +63,8 @@ public class StaticMessageChannel extends DiscordChannel {
|
||||
}
|
||||
|
||||
private void init() {
|
||||
System.out.println("Initializing " + getChannel());
|
||||
if(getChannel().getLatestMessageIdLong() != 0)
|
||||
message = getChannel().getIterableHistory().complete().stream().filter(m -> m.getAuthor().isBot()).findFirst().orElse(null);
|
||||
message = getChannel().getIterableHistory().onErrorMap(throwable -> Collections.emptyList()).complete().stream().filter(m -> m.getAuthor().isBot()).findFirst().orElse(null);
|
||||
|
||||
VelocityCore.schedule(this::update);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user