QuickStart
Invite the Bot
First, click this link and select the desired server from the drop down.
Load up some settingsThe 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.
FeaturesRepost Filter
By creating a PHash of every image posted into the selected channels and comparing it against new images, reposts are able to be detected according to the users settings. The system supports detection of compressed, cropped or even hue-shifted images by making use of multiple hashing algorithms. Sadly, due to performance reasons the bot won’t process images larger than 10MP, this will hopefully be fixed when the Porn Filter is added.
Porn Filter(Coming Soon)Using the DeepDanbooru and nude.js projects, PureImage is able detect if a post is considered pornographic and either flag or delete it depending on the server configuration. Additionally, several other porn detection libraries such nude.py are used, the thresholds and settings can all be customized in the settings.
Coming SoonNew Features Coming Soon:
- Additional Customization (Ability to change Messages, Config …etc.)
- Porn Filter
- Better Repost Detection
[July 15] Public Release
- Improved Documentation
- Added a timeout settings for repost cog
- Fixed a database issue that prevented the bot from working
- Added Settings Cog, allowing customization from a JSON file
- Moved from local storage to an sqlite3 database.
- Added Repost Cog, allowing for repost detection of duplicate images.
Compared to other bots, the server config isn’t set and change via commands. Instead it’s stored in JSON which a server owner and message to the bot. This makes it easier for server owners to setup the bot as they don’t have to rely on bot commands, instead all options can be changed using a preset. In order to change the bots settings you should send it a [settings.json] file in a guild chat message using the ‘~set’ command.
JSONThe settings are stored in JSON, this is text based file format that is easy for computer and humans to understand. In order to help editing these settings try using an Online Editor that provides syntax highlighting.
Channel IDsMany of the commands rely on channel ids, this a unique number that identifies a discord channel. In order to get these IDs either follow this Guide or use the ‘~id’ command.
SettingsReposts
If the repost component of the bot
“Enabled”: true/false
The Channels that a bot will check for reposts in, stored in channel ids.
“Channels”: [1,2,3]
If the bot should delete reposts instead of just flagging them for people to see
“Delete”: true/false
The timeout for people to be able to repost an image in seconds (e.g. 86400 = 60 x 60 x 24 = 1 Day)
Porn Filter (Coming Soon)“Timeout”: 86400
If the Porn Filter Component should be enabled
“Enabled”: false,
If the bot should use the NSFW tag to see what channels it should check.
“NSFWChannels”: true/false
the channels that the bot will ignore, for more control.
“IgnoreChannels”: [123,124,125]
The threshold used for determining if something is porn, between 1 and 0. 1 is confirmed and 0 is completely safe.
Messages“Threshold”: 0.0 - 1.0
“rDetect”: ["> {AUTHOR},You seem to have posted a repost"],
The messages sent to someone when their repost is detected, randomly chosen. Additionally, the text will can formatted using the format strings below, just surround the word with semicolons:
Format Text:
- author
- The repost message's author's name.
- AUTHOR
- Pinging the repost message's author.
- origin
- The original author's name.
- ORIGIN
- Pinging the original author.
Formatting Example
"{AUTHOR}, Uh oh a repost you stole from {ORIGIN}"
“pDelete”: ["> Hmmmmmmm, You seem to have posted porn. I ask thou… why?"]
The messages sent to someone when their post is detected as porn, randomly chosen. Additionally, the text will can formatted using the format strings below, just surround the word with semicolons:
Format Text:
- author
- The repost message's author's name.
- AUTHOR
- Pinging the repost message's author.
- certainty
- The certainty that this image is porn.
Formatting Example
["{AUTHOR}, Uh oh I'm {certainty} that's porn","{AUTHOR}, I think that might be porn"]
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 GOES HERE”
Then run the setup.py file in order to regenerate the databases.
python setup.py
Finally, run the main file
Contributingpython main.py
If you find any vulnerabilities, problems, just send me an email or file an issue.