Skip to content

Fixed Exception when ScamBlocker checks messages outside of TextChannel #1217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2025

Conversation

Zabuzard
Copy link
Member

@Zabuzard Zabuzard commented Mar 6, 2025

Fixes the following exception that keeps happening currently:

One of the EventListeners had an uncaught exception
java.lang.IllegalStateException: Cannot convert channel of type ThreadChannel to TextChannel!
at net.dv8tion.jda.internal.utils.ChannelUtil.safeChannelCast(ChannelUtil.java:51)
at net.dv8tion.jda.internal.entities.channel.AbstractChannelImpl.asTextChannel(AbstractChannelImpl.java:82)
at org.togetherjava.tjbot.features.moderation.scam.ScamBlocker.onMessageReceived(ScamBlocker.java:133)
at org.togetherjava.tjbot.features.system.BotCore.lambda$onMessageReceived$9(BotCore.java:221)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1858)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/jav...

@Zabuzard Zabuzard added bug Something isn't working priority: normal labels Mar 6, 2025
@Zabuzard Zabuzard self-assigned this Mar 6, 2025
@Zabuzard Zabuzard requested a review from a team as a code owner March 6, 2025 08:27
@Zabuzard Zabuzard force-pushed the bugfix/scam_blocker_text_channel_crash branch from b80cee4 to d400f24 Compare March 6, 2025 08:55
Copy link

sonarqubecloud bot commented Mar 6, 2025

@Zabuzard Zabuzard merged commit cd75db6 into develop Mar 6, 2025
11 checks passed
@Zabuzard Zabuzard deleted the bugfix/scam_blocker_text_channel_crash branch March 6, 2025 09:01
@Zabuzard Zabuzard mentioned this pull request May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: normal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant