-
Notifications
You must be signed in to change notification settings - Fork 6
Add automod event logging to user mod threads #243
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
Conversation
PR Summary
|
|
I still need to properly review and vet this, there are probably a couple of significant improvements left to be made |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds logging functionality for Discord's built-in automod trigger events to user moderation threads.
Changes:
- Added AutoModerationExecution gateway intent to receive automod events
- Implemented event handler for automod actions with two-path approach: full message logging when available, fallback logging otherwise
- Created reportAutomod() function for logging automod actions without full message objects
- Modified escalationControls() to accept either Message or userId for broader compatibility
- Added automod enum value to ReportReasons
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| notes/2026-01-13_1_automod-logging.md | Documentation of implementation approach and design decisions |
| app/models/reportedMessages.server.ts | Added automod reason enum value |
| app/helpers/modLog.ts | Implemented reportAutomod() function and helper for thread creation |
| app/helpers/escalate.tsx | Made escalationControls() accept Message or userId string |
| app/discord/client.server.ts | Added AutoModerationExecution intent |
| app/discord/automod.ts | Implemented AutoModerationActionExecution event handler |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add AutoModerationExecution intent to Discord client - Handle AutoModerationActionExecution events in automod.ts - Create reportAutomod() function for cases where message isn't available - Modify escalationControls() to accept userId string directly - Add automod enum value to ReportReasons When automod triggers, the bot now logs the action to the user's mod thread. If the message is still available, it uses the full reportUser() flow. If blocked/deleted by automod, it uses a fallback that logs available context (rule name, matched content, action type). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This whole thing tbh should get stripped down into a fresh set of base building blocks, the Discord.js SDK objects aren't working well as abstractions here. It needs to be more testable so we can verify its behavior more precisely
Preview environment removedThe preview for this PR has been cleaned up. |
✅ E2E Tests PassedTested against: https://243.euno-staging.reactiflux.com |
When automod triggers, the bot now logs the action to the user's mod thread. If the message is still available, it uses the full reportUser() flow. If blocked/deleted by automod, it uses a fallback that logs available context (rule name, matched content, action type).