This bot provides automated text moderation for Discord text channels. It uses OpenAI API text completions GPT-3 to rewrite any negative messages from users in text channels into a positive message.
The bot monitors all messages in a text channel. If a message contains a negative word, the bot will rewrite the message using GPT-3. The bot will then delete the original message and replace it with the rewritten message.
-
Create a Discord bot and invite it to your server. See this guide for more information.
-
Create an OpenAI API key. See this guide for more information.
-
Clone this repository and install the dependencies.
git clone
cd ModerationGPT
bundle install- Create a file called
.envin the root directory of the repository. Add the following lines to the file, replacing the values with your own.
# .env
OPENAI_API_KEY=my_openai_secret
DISCORD_BOT_TOKEN=my_discord_secret
REDIS_URL=redis://localhost:6379/0Use direnv or source .env the file manually.
- Run the bot.
bundle exec ruby bot.rbContributions are welcome! Please open an issue or pull request if you would like to contribute.
This project is licensed under the MIT License - see the LICENSE file for details.