Overview
This Python-based Discord bot is designed to tackle the common issue of repetitive media posts within server channels. It intelligently detects and manages reposted images, GIFs, and video clips, helping maintain channel clarity.
Utilizing perceptual hashing (pHash), the bot identifies visually similar media, making it resilient to minor edits, format changes, or compression differences often seen in reposts. After a one-time setup by an administrator to designate an alert channel, the bot automatically flags duplicates, notifies the designated channel, and removes the repost.
How It Works (Simplified)
The bot follows these core steps:
- Listens for messages containing supported media (images, GIFs, videos).
- Downloads the media content for analysis.
- Calculates perceptual hash(es) for the media (pHash for images/GIF frames).
- Queries the database for visually similar hashes previously posted within that server.
- If a similar hash is found & alert channel is configured: Sends an alert to the designated channel and deletes the repost message.
- If no similar hash found OR alert channel not set: Stores the new hash in the database (or prompts for setup if a repost is detected before the alert channel is configured).
Status & Source Code
This project demonstrates practical application of image/video processing and Discord bot development. Setup involves managing dependencies and Discord API configuration.
The full source code, detailed setup instructions, and contribution guidelines are available on GitHub.
License: MIT
View on GitHub