Discord bot that automatically detects scam images using perceptual hashing
- Automatic scam image detection in messages
- Hash comparison with configurable tolerance threshold
- Global and per-server database
- Automatic reports with action buttons
- Configurable automatic actions (delete, mute, kick, ban)
- Detection statistics tracking
- User notifications via DM
- False positives system
- Export/Import hashes
- Install dependencies:
pip install -r requirements.txt- Create a
.envfile from.env.example:
cp .env.example .env- Add your Discord token in
.env:
DISCORD_TOKEN=your_token_here
- Run the bot:
python bot.py/help - Display available commands
- none - Report only, no action taken
- delete - Delete the message (default)
- mute - Delete message + mute user for 1 hour
- kick - Delete message + kick user
- ban - Delete message + ban user
If an image is incorrectly flagged:
- Click the "False Positive" button in the report
- The hash will be whitelisted for your server
- Future messages with that image won't trigger detections
- The button will change to "Mark as Scam" to allow reverting the decision
The threshold determines detection sensitivity:
- 0 = Exact match only
- 5 = Recommended (tolerates compression, resizing)
- 10+ = More permissive (may generate false positives)