Skip to content

Commit

Permalink
fix(chat): Minecraft events were not being forwarded to Discord forum…
Browse files Browse the repository at this point in the history
… threads (fixes #121)
  • Loading branch information
axieum committed Mar 4, 2024
1 parent c808357 commit 515eeb4
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 515eeb4

Please sign in to comment.