Sven is a Discord bot that utilizes OpenAI's Moderation API for text moderation and HuggingFaces' transformer model for image moderation. This bot helps maintain a safe and respectful environment in your Discord server. This bot is COMPLETELY FREE to use as OpenAI's Moderation API is free, and so is HuggingFace! Your OpenAI API key is only needed to prove to OpenAI that you are an API user. Rest assured however, you will not be charged!
Follow these steps to set up your own instance of AI-Discord-Mod:
Ensure you have the following installed:
Install the necessary Python packages with the following commands:
pip install -r requirements.txt
pip install transformers datasets
pip install torch # or pip install tensorflow depending on your preference
git clone https://github.com/gravelBridge/AI-Discord-Mod.git
cd AI-Discord-Mod
cp .env.template .env
OPENAI_API_KEY
and DISCORD_BOT_TOKEN
. Set the USE_TRIGGERING_WORDS
and TRIGGERING_WORDS
values as per your preference.# OPENAI_API_KEY: Your OpenAI API Key, must be connected to an account with a payment method.
OPENAI_API_KEY=your_openai_api_key
#DISCORD_BOT_TOKEN: Your Discord Bot Token that's in your Discord Server.
DISCORD_BOT_TOKEN=your_discord_bot_token
# USE_TRIGGERING_WORDS: If the bot should only send requests for moderation if the message contains a triggering word that is defined below.
USE_TRIGGERING_WORDS=True
# TRIGGERING_WORDS: A txt file directory to a list of triggering words, comma separated, that have to sent in order for message to be checked via AI.
TRIGGERING_WORDS=The text file directory
.env
file.To run the bot, navigate to the project directory and run:
python ai-discord-moderator/discord_bot.py
For help, run the /help command in your discord server!
The bot should now be active in your Discord server and automatically moderate text and images based on the rules defined in the ai_discord_functions.py and discord_bot.py scripts.
This bot uses AI models which, while powerful, might not always make perfect decisions. It is recommended to have human moderators oversee the bot's actions for best results.
This project is licensed under the GPL-3.0 License. See the LICENSE file for details.