Giter VIP home page Giter VIP logo

ai-discord-mod's Introduction

๐Ÿค– AI-Discord-Mod: Sven ๐Ÿค–

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!

Screenshot 2023-05-15 at 9 14 12 PM

๐Ÿš€ Add an Invite-Ready, Hosted Sven Here: Invite Sven

๐ŸŒŸ Features

  • Text moderation using OpenAI's Moderation API
  • Image moderation using HuggingFaces' transformer model
  • Warns and mutes users for inappropriate messages
  • Configurable warning limit and mute duration

๐Ÿš€ Getting Started

Follow these steps to set up your own instance of AI-Discord-Mod:

๐Ÿ“‹ Prerequisites

Ensure you have the following installed:

  • Python 3.6 or later
  • pip (Python package installer)

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

๐Ÿค– Setting up a Discord Bot

  1. Go to the Discord Developer Portal.
  2. Click on "New Application". Give it a name and click on "Create".
  3. Go to the "Bot" tab and click on "Add Bot". You will see a message saying "A wild bot has appeared!", click "Yes, do it!".
  4. Under the "Token" section, click on "Copy". This will be your DISCORD_BOT_TOKEN. Remember to keep this secret!
  5. Go to the "OAuth2" tab, under "Scopes" tick "bot", then under "Bot Permissions" tick "Administrator".
  6. You will see a generated URL, use this URL to invite your bot to your Discord server.

๐Ÿ›  Setting up the AI-Discord-Mod Project

  1. Clone this repository to your local machine: git clone https://github.com/gravelBridge/AI-Discord-Mod.git
  2. Navigate to the project directory: cd AI-Discord-Mod
  3. Copy the .env.template file and rename it to .env: cp .env.template .env
  4. Open the .env file in a text editor and replace the placeholders with your OPENAI_API_KEY and DISCORD_BOT_TOKEN. Set the USE_TRIGGERING_WORDS and TRIGGERING_WORDS values as per your preference.
  5. Your .env file should look like this:
    # 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
    
  6. Save and close the .env file.

๐Ÿƒ Running the Bot

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.

โš ๏ธ Note

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.

๐Ÿ“ License

This project is licensed under the GPL-3.0 License. See the LICENSE file for details.

โญ Remember to leave a star! It gives me motivation to keep working on awesome projects like this. โค๏ธ

ai-discord-mod's People

Contributors

gravelbridge avatar bentlybro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.