From 7577a95b3623e96cd09ca2fa52705f9c50388c1e Mon Sep 17 00:00:00 2001 From: Jonathan Hiles Date: Mon, 4 Mar 2024 17:40:40 +1000 Subject: [PATCH] fix(chat): Minecraft events were not being forwarded to Discord forum threads (fixes #121) --- .../mcmod/minecord/impl/chat/util/DiscordDispatcher.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/minecord-chat/src/main/java/me/axieum/mcmod/minecord/impl/chat/util/DiscordDispatcher.java b/minecord-chat/src/main/java/me/axieum/mcmod/minecord/impl/chat/util/DiscordDispatcher.java index 1e75e3d..6739f18 100644 --- a/minecord-chat/src/main/java/me/axieum/mcmod/minecord/impl/chat/util/DiscordDispatcher.java +++ b/minecord-chat/src/main/java/me/axieum/mcmod/minecord/impl/chat/util/DiscordDispatcher.java @@ -5,7 +5,7 @@ import java.util.function.Predicate; import net.dv8tion.jda.api.EmbedBuilder; -import net.dv8tion.jda.api.entities.channel.concrete.TextChannel; +import net.dv8tion.jda.api.entities.channel.middleman.GuildMessageChannel; import net.dv8tion.jda.api.requests.restaction.MessageCreateAction; import net.dv8tion.jda.api.utils.messages.MessageCreateBuilder; import org.jetbrains.annotations.Nullable; @@ -141,7 +141,9 @@ public static void dispatch( // Build and queue each chat entry .forEach(entry -> { // Fetch the channel - final @Nullable TextChannel channel = jda.getTextChannelById(entry.id); + final @Nullable GuildMessageChannel channel = jda.getChannelById( + GuildMessageChannel.class, entry.id + ); // Check that the channel exists if (channel == null)