Skip to content
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

Fix automatic warnings on AutoMod-blocked messages for forum channels #225

Merged

Conversation

FloatingMilkshake
Copy link
Collaborator

This PR closes #224.

Previously when AutoMod would block thread creation in a forum channel (original message matched a filter), Cliptok would catch the AutoMod block and attempt to send its automatic warning message directly into the forum channel—this would fail, because you cannot send a text message into a GuildForum channel. Thus the entire warning would fail. This PR adds a configurable fallback channel (forumChannelAutoWarnFallbackChannel in config.json) that is used for warning messages where the warning is in response to an AutoMod-blocked message in a GuildForum channel.

(Note that for messages inside an already-created thread, the warning message is sent in the thread—those have different channel types, like PublicThread and PrivateThread.)

Events/MessageEvent.cs Outdated Show resolved Hide resolved
Also adds handling for when this config value is missing
@FloatingMilkshake FloatingMilkshake merged commit b0be937 into main Sep 4, 2024
2 checks passed
@FloatingMilkshake FloatingMilkshake deleted the floatingmilkshake/automod-autowarn-forum-fix branch September 4, 2024 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
2 participants