Skip to content

Conversation

@vcarl
Copy link
Member

@vcarl vcarl commented Jan 14, 2026

  • 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).

@vcarl vcarl requested a review from Copilot January 14, 2026 00:25
@what-the-diff
Copy link

what-the-diff bot commented Jan 14, 2026

PR Summary

  • Logging for Discord Built-in Automoderation Events
    The team has added a new feature to keep a record of built-in automoderation events on Discord to user moderation threads.

  • Automod Event Handling
    An event handler has been set up to help manage automoderation actions. However, for 'Timeout' actions, no logs are being kept as these events generally don't include any message content.

  • Message Fetch and Report
    The PR includes some improvements in how we handle messages. When a 'messageId' is available, the system tries to fetch the message. If this is successful, the system uses 'reportUser()'. If it fails, the system falls back on a 'reportAutomod()' function.

  • New 'reportAutomod()' Function
    A new feature of logging is introduced in case we do not have a full 'Message' object available.

  • Escalation Controls
    The escalation controls have been updated. Now they can accept a 'Message' or a 'userId' string.

  • ReportReasons Update
    The 'ReportReasons' category has been updated to include 'automod'.

  • New Documentation
    The team has created new documentation explaining the changes and the thought process behind these changes.

@vcarl
Copy link
Member Author

vcarl commented Jan 14, 2026

I still need to properly review and vet this, there are probably a couple of significant improvements left to be made

@vcarl vcarl linked an issue Jan 14, 2026 that may be closed by this pull request
Copy link
Contributor

Copilot AI left a 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.

vcarl and others added 3 commits January 14, 2026 11:42
- 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
@vcarl vcarl marked this pull request as ready for review January 15, 2026 18:35
@github-actions
Copy link

github-actions bot commented Jan 15, 2026

Preview environment removed

The preview for this PR has been cleaned up.

@vcarl vcarl merged commit 72d1485 into main Jan 15, 2026
5 of 6 checks passed
@vcarl vcarl deleted the vc-tracking branch January 15, 2026 20:02
@github-actions
Copy link

✅ E2E Tests Passed

View Report · View Run

Tested against: https://243.euno-staging.reactiflux.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Record auto mod mentions in moderation threads

2 participants