Fix conflict between automatic empty thread delete & auto-warn #230
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.