diff --git a/VelocityCore/src/de/steamwar/velocitycore/discord/DiscordBot.java b/VelocityCore/src/de/steamwar/velocitycore/discord/DiscordBot.java index cf56ea58..40dee4b1 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/discord/DiscordBot.java +++ b/VelocityCore/src/de/steamwar/velocitycore/discord/DiscordBot.java @@ -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.") diff --git a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java index 4c8d832b..6d43b8f7 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java +++ b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java @@ -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); }