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 conflict between automatic empty thread delete & auto-warn #230

Merged
merged 2 commits into from
Sep 18, 2024

Conversation

FloatingMilkshake
Copy link
Collaborator

This PR closes #223.

If a user opens a forum thread and their original message contains content that Cliptok would issue an automatic warning for, it will delete the thread and send the warning to the configured fallback channel*. This bypasses the existing empty thread auto-delete logic, because we do not delete the message before deleting the thread—therefore we no longer have a conflict between the auto-warn and thread auto-delete logic. The infringing message is logged to the typical mod log channels when the warning is issued, so it's not a concern that the individual message isn't logged to message log channels like it would typically be when deleted.

Since this does not target any specific forum channels and instead only compares types (DiscordChannelType.GuildForum), it applies to any forum channel—#tech-support-forum, #feedback-hub-forum, etc!

*If no fallback channel is configured, Cliptok will still attempt to send into the thread, but will probably fail. It will also log a warning suggesting that you configure a fallback channel.

Copy link
Owner

@Erisa Erisa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine. Only comment is that wasAutoWarn is an odd way to pass this intent when all it does is change a 0 to a 1, maybe a minMessages param would work better that defaults to 0 annd can be changed to 1.

@FloatingMilkshake
Copy link
Collaborator Author

I considered using something like minMessages—not sure why I decided against it. So there it is :P

@FloatingMilkshake FloatingMilkshake merged commit 89d8aef into main Sep 18, 2024
2 checks passed
@FloatingMilkshake FloatingMilkshake deleted the floatingmilkshake/forum-channel-auto-warn-fix branch September 18, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Bug: Automatic deletion of empty tech support threads can conflict with auto-warn
2 participants