Skip to content

Fix repost detection ignoring forwarded messages#1313

Draft
peterdragun with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-repost-detection-issue
Draft

Fix repost detection ignoring forwarded messages#1313
peterdragun with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-repost-detection-issue

Conversation

Copilot AI commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

PR type

  • Refactor/Enhancement
  • New Feature
  • Bug Fix
  • Documentation Update

Description

Discord forwarded messages carry attachments in message.message_snapshots[*].attachments, not in message.attachments (which is empty). The Warden cog's repost detection only checked message.attachments, causing forwarded images to bypass duplicate detection entirely.

  • cogs/warden/cog.pydoCheckRepost now also triggers when any forwarded snapshot has attachments:
    has_attachments = len(message.attachments) > 0 or any(
        len(snapshot.attachments) > 0 for snapshot in (message.message_snapshots or [])
    )
  • cogs/warden/features.pysaveMessageHashes collects attachments from both direct attachments and all message_snapshots before hashing, so forwarded images are stored and compared against the database.

Related Issue(s)

After checks

  • PR was tested
  • Major change (packages, libraries, etc.)

Post deployment

  • Reload cog(s) warden

UI changes

Agent-Logs-Url: https://github.com/vutfitdiscord/rubbergod/sessions/bd4de0d7-4d43-4dd5-b793-329a7dddb9c3

Co-authored-by: peterdragun <43444182+peterdragun@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix repost detection to include forwarded messages Fix repost detection ignoring forwarded messages Apr 7, 2026
Copilot AI requested a review from peterdragun April 7, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Repost detection seems to ignore forwarded messages

2 participants