Ben-Brady / PureImage

A discord bot for automatically detecting duplicate images using perceptual image hashing and similar techniques.
6 stars 6 forks source link
bot discord discord-bot duplicate-detection image-classification image-processing python

PureImage

QuickStart

Invite the Bot

First, click this link and select the desired server from the drop down.

Load up some settings

The bot handles settings through a settings.json file, this handles options such as what channels the bot is active on. Due to this, the bot won't work when you first invite it and you will have to set it up. The instructions will be messaged to the server owner when you invite the bot, these instructions can be found in the QuickStart.md file.

Repost Filter

By creating a Perceptual Image Hash of every image posted in the selected channels and comparing against the hashes of already posted images, the bot can detect when an image is too similar to a past image and take action based on your settings. Using a perceptual hash prevents lower quality versions of the same image not being detected. Sadly due to performance reasons, images will be skipped if they're larger than 10MegaPixels or 4MB, the megapixel issue may be removed in the future but the 4MB limit will most likely not.

Coming Soon

New Features Coming Soon:

Changelog

[October 19] V1.1

[July 15] Public Release

[July 5] Beta 2.1

[July 5] Beta 2

[June 28] Beta 1

Hosting the Bot

I'm completely fine with you hosting the bot, even on a large scale. However, just don't claim to have made the bot and make sure you post a link to this repo. After that it's fair game.

In order to host the bot just install the python requirements using the requirements.txt

pip install -r requirements.txt

Then place your bot token into the .env file

TOKEN = "BOT_TOKEN"

Then run the setup.py file in order to regenerate the databases and perform other setup.

python setup.py

Finally, run the main file

python main.py

Contributing

If you find any vulnerabilities/problems, just send me an email or file an issue.

If you wish to develop, set the enviroment variable to increase verbosity and store the database in memory.

DEPLOYMENT = "TESTING"