Improve CouncilChannel and StaticMessageChannel

This commit is contained in:
2025-11-07 08:39:42 +01:00
parent 160f982955
commit f0e18bfc72
2 changed files with 5 additions and 2 deletions
@@ -46,7 +46,9 @@ public class CouncilChannel extends StaticMessageChannel {
List<Member> 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;
@@ -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() {