Skip to content

Add Image Hash filter list#3532

Merged
ChrisLovering merged 8 commits into
mainfrom
jb3/image-hash-filter-list
Jul 2, 2026
Merged

Add Image Hash filter list#3532
ChrisLovering merged 8 commits into
mainfrom
jb3/image-hash-filter-list

Conversation

@jb3

@jb3 jb3 commented Jun 29, 2026

Copy link
Copy Markdown
Member

This PR migrates image scam detection from the hardcoded unique image filter to a dynamic image_hash filter list.

  • Added a new image_hash filter type and image_hash deny list flow in filtering.
  • Removed the unique image filter implementation
  • Added shared Rhodium hash helpers and updated hash parsing to use Rhodium's hex response key.
  • Added a moderator utility command: !filter imagehash (alias: !filter hash) to hash an attached image and return both hex and i64 hash
  • Updated image hash alert formatting so #mod-alert output always includes a description (with fallback text if missing)

A manual migration of the currently known image hashes is required after deploy. Hashes must be added as image_hash deny filters (this time using hex values instead of the integer hashes).

@jb3 jb3 requested a review from mbaruh as a code owner June 29, 2026 20:23
@swfarnsworth

Copy link
Copy Markdown
Contributor

I get expected behavior when running !filter hash but can't find a way to add a new image hash filter.

image

@swfarnsworth

Copy link
Copy Markdown
Contributor

It appears that one needs to run !filterlist add deny image_hash in a server when running this functionality for the first time. One must also ensure that the filter list itself is set to enabled (it is not by default), or none of the filters in the list will work, even if they themselves are activated.

Separately from the goal of this PR, I may have found a bug in !filterlist edit command. !filterlist edit noui image_hash enabled=True causes RuntimeError: dictionary keys changed during iteration. I'll investigate and potentially open another PR.

Standby while I continue to test this functionality.

@swfarnsworth

Copy link
Copy Markdown
Contributor

I've confirmed that the filter list works, though I wonder if it would be possible for the mod alert to tell us what the similarity score was between the posted image and the match. What do you think, @jb3?

image

@ChrisLovering ChrisLovering left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks

@ChrisLovering ChrisLovering merged commit 35d9e45 into main Jul 2, 2026
4 of 5 checks passed
@ChrisLovering ChrisLovering deleted the jb3/image-hash-filter-list branch July 2, 2026 18:30
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.

3 participants