Skip to content

Commit 64216c2

Browse files
authored
fix(chat): Minecraft events were not being forwarded to Discord forum threads (fixes #121) (#123)
1 parent fd8a666 commit 64216c2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

minecord-chat/src/main/java/me/axieum/mcmod/minecord/impl/chat/util/DiscordDispatcher.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import java.util.function.Predicate;
66

77
import net.dv8tion.jda.api.EmbedBuilder;
8-
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
8+
import net.dv8tion.jda.api.entities.channel.middleman.GuildMessageChannel;
99
import net.dv8tion.jda.api.requests.restaction.MessageCreateAction;
1010
import net.dv8tion.jda.api.utils.messages.MessageCreateBuilder;
1111
import org.jetbrains.annotations.Nullable;
@@ -141,7 +141,9 @@ public static void dispatch(
141141
// Build and queue each chat entry
142142
.forEach(entry -> {
143143
// Fetch the channel
144-
final @Nullable TextChannel channel = jda.getTextChannelById(entry.id);
144+
final @Nullable GuildMessageChannel channel = jda.getChannelById(
145+
GuildMessageChannel.class, entry.id
146+
);
145147

146148
// Check that the channel exists
147149
if (channel == null)

0 commit comments

Comments
 (0)