Skip to content

chrismuzyn/PureImage

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

  • Easier and More Diverse Customization
  • Improved Repost Detection by making use of multiple hashes
  • Making use of of a new hash database
  • Improved Video Repost Detect. (Currently using SHA-256)

Changelog

[October 19] V1.1

  • [#5eb7c3]: Moved default settings to Guild.py instead of settings.json
  • [#c1e8da]: Chnaged Log to bs stored in .ssv to avoid comma injection
  • [#091498]: Rewrote most of Repost Handlers
  • [#69c010]: Changed how Guild's settings are stored
  • [#56da4a]: 56da4ac: Removed matplotlib from dependencies
  • [#54ce43]: Fixed Vanity Cog not being correctly initiated
  • [#1b3d91]: Updated .gitignore
  • [#d186e5]: Changled logging strucutre to differ between stream and file. Now file logging will be saved as .csv files.
  • [#c8f5d5]: Changed file structure and added test data to prepare for automated testing enviroment
  • [#26d7f3]: Updated .gitignore in an attempt to prevent .env from being updated
  • [#fb25e3]: Removed example .env to prevent token leakage when making commits
  • [#45a5bf]: Added an alert for the bot owner for when a guild invites the bot
  • [#ee6f77]: Setup only creates tables if they don't exist
  • [#fe0ae6]: Removed all references to the porn detector, discord's built-in detection would likely perform much better.
  • [#43c5d2]: Fixed an type on the guilds.Check SQL statement that caused an error, this caused the lack of on join message.

[July 15] Public Release

  • Improved Documentation
  • Added a timeout settings for repost cog

[July 5] Beta 2.1

  • Fixed a database issue that prevented the bot from working

[July 5] Beta 2

  • Added Settings Cog, allowing customization from a JSON file
  • Moved from local storage to an sqlite3 database.

[June 28] Beta 1

  • Added Repost Cog, allowing for repost detection of duplicate images.

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"

About

A discord bot for automatically detecting duplicate images using perceptual image hashing and similar techniques.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%