This repository is now deprectated. If you are looking into something similar, try ChatCop. Lear nore about it here.
A Discord bot that uses Google's Perspective API to moderate chat.
There are three ways to use the Moderator Bot:
This is the simplest option - simply invite the bot to your Discord server by clicking here. You will need to have administrator permissions on your server to use the bot.
To run the bot using Docker, use the following command:
docker run -e DISCORD_TOKEN=<your_discord_token> -e PERSPECTIVE_API_KEY=<your_perspective_api_key> -d /path/to/your/data:/Moderator/data ghcr.io/nicebots-xyz/moderator:latest
To run the bot on your local machine, clone this repository at /Paillat-Dev/Moderator
and create a .env
file with the following two values:
DISCORD_TOKEN=<your_discord_token>
PERSPECTIVE_API_KEY=<your_perspective_api_key>
Then run main.py
to start the bot, but remember to install the required packages first with
pip install -r requirements.txt.
Note: If you're not comfortable with any of the above steps, we recommend using option 1.
The Moderator Bot has the following command:
This command allows you to set the threshold for each type of toxicity. The options for toxicity are:
- toxicity
- severe_toxicity
- identity_attack
- insult
- profanity
- threat
- sexually_explicit
- flirtation
- obscene
- spam
To use the /setthreshold
command, you must have administrator permissions. If a value is not specified, the default threshold will be set to the best avlues I found. You can view the current settings for your server by using the /setthreshold
command without any options. You will need to run this command at least once when adding the bot to your server for the firs time.
Command used to setup/change misc parameters, like:
logs_channel
: The channel where you want the logs & updates being sent, usually a channel accessible only to moderators, please be shure of checking that moderator has acces to the channel.enable
: TRUE / FALSE , self explanatory- mod_role : the role of the moderators. Used to ping the moderators when the bot is unsure of the toxicity of a message
Get the current settings.
Get some help & explanations.
A debug / testing command. Used to get the values detected by the bot for a given message and see if it would have been deleted, usually used to tweak the settings with /setthreshold
.
- Discord - Communication platform for communities
- Python - Programming language
- py-cord
- Google Perspective API - API for monitoring online conversations for toxic behavior
- SQLite3 - SQL database engine wrapper for Python
- Docker - Containerization platform
- Paillat-Dev - Initial work
This project is licensed under the MIT License.