From f0e18bfc720eb8ee4e668e9972d45044ab8d0ba6 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Fri, 7 Nov 2025 08:39:42 +0100 Subject: [PATCH] Improve CouncilChannel and StaticMessageChannel --- .../velocitycore/discord/channels/CouncilChannel.java | 4 +++- .../velocitycore/discord/channels/StaticMessageChannel.java | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/CouncilChannel.java b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/CouncilChannel.java index 7f1b1d60..0f0b8417 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/CouncilChannel.java +++ b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/CouncilChannel.java @@ -46,7 +46,9 @@ public class CouncilChannel extends StaticMessageChannel { List members; try { - members = DiscordBot.getGuild().findMembersWithRoles(role).get(); + members = DiscordBot.getGuild().findMembersWithRoles(role).onError(throwable -> { + // Ignore + }).get(); } catch (Exception e) { VelocityCore.getLogger().warning("Could not get members for " + role.getName()); return messageCreateBuilder; diff --git a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java index 5108b1d2..f959e1f4 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java +++ b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java @@ -19,6 +19,7 @@ package de.steamwar.velocitycore.discord.channels; +import de.steamwar.velocitycore.VelocityCore; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.entities.Message; import net.dv8tion.jda.api.entities.channel.middleman.MessageChannel; @@ -64,7 +65,7 @@ public class StaticMessageChannel extends DiscordChannel { if(getChannel().getLatestMessageIdLong() != 0) message = getChannel().getIterableHistory().complete().stream().filter(m -> m.getAuthor().isBot()).findFirst().orElse(null); - update(); + VelocityCore.schedule(this::update); } public void update() {