- 📍 Overview
- 📦 Features
- 📂 Structure
- 💻 Installation
- 🏗️ Usage
- 🌐 Hosting
- 📄 License
- 👏 Authors
This repository houses "ModerationBot," a Discord bot designed for server moderation and management. It leverages advanced features like automated message filtering, role management, moderation commands, user logging, customizable rules, and more. ModerationBot helps cultivate a positive and organized environment for your Discord communities.
Feature | Description | |
---|---|---|
⚙️ | Architecture | The codebase follows a modular architecture, separating different functionalities into distinct modules for improved organization and maintainability. |
📄 | Documentation | This README provides a comprehensive overview of the bot's features, installation, usage, and development details. |
🔗 | Dependencies | The bot utilizes essential libraries and packages like Discord.js, Mongoose, OpenAI API, and other tools for handling Discord interactions, database management, and advanced AI functionality. |
🧩 | Modularity | Code is structured into modules for commands, utilities, events, models, and services, promoting code reusability and ease of maintenance. |
🧪 | Testing | Unit tests are implemented using Jest to ensure the bot's functionality is correct and reliable. |
⚡️ | Performance | The bot's design prioritizes performance, employing efficient data structures and algorithms for responsiveness. |
🔐 | Security | Security measures include input validation, data sanitization, and secure API handling to protect user data and server integrity. |
🔀 | Version Control | The project uses Git for version control, facilitating collaboration and managing code changes. |
🔌 | Integrations | The bot integrates with the Discord API, MongoDB database, and OpenAI API for seamless functionality. |
📶 | Scalability | The architecture is designed to scale efficiently, allowing for handling a large number of users and messages. |
├── .env
├── package.json
├── tsconfig.json
├── postcss.config.js
├── tailwind.config.js
├── Dockerfile
├── .github
│ └── workflows
│ └── main.yml
└── src
├── index.ts
├── commands
│ ├── moderation.ts
│ ├── roles.ts
│ ├── logging.ts
│ └── customRules.ts
├── utils
│ ├── config.ts
│ ├── database.ts
│ ├── nlp.ts
│ ├── discord.ts
│ └── logger.ts
├── events
│ ├── messageCreate.ts
│ ├── guildMemberAdd.ts
│ └── guildMemberRemove.ts
├── models
│ ├── user.ts
│ ├── guild.ts
│ └── message.ts
└── services
├── moderationService.ts
├── roleService.ts
├── loggingService.ts
└── customRulesService.ts
- Node.js (v18 or later)
- npm (or yarn)
- MongoDB
- Clone the repository:
git clone https://github.com/spectra-ai-codegen/discord-server-moderation-bot.git
- Navigate to the project directory:
cd discord-server-moderation-bot
- Install dependencies:
npm install
- Set up environment variables:
- Create a
.env
file in the root directory. - Add the following environment variables:
DISCORD_TOKEN=your_discord_bot_token MONGO_URI=mongodb://your_mongodb_host:27017/your_database_name OPENAI_API_KEY=your_openai_api_key
- Create a
- Start the bot:
npm start
To use ModerationBot, follow these steps:
- Invite the bot to your server:
- Obtain the bot's invite link from the Discord developer portal (see the Discord Developer Portal for instructions).
- Grant permissions:
- When inviting the bot, ensure you grant it the necessary permissions for moderation, such as "Kick Members," "Ban Members," "Manage Channels," and "Manage Roles."
- Configure settings (optional):
- Use the bot's commands or a custom dashboard (if implemented) to set up custom rules, filtering options, and other configurations.
- Build the application:
npm run build
- Deploy to a cloud platform:
- Heroku, AWS, Google Cloud, or any other hosting platform of your choice.
- Set up environment variables on the hosting platform:
- Ensure the environment variables
DISCORD_TOKEN
,MONGO_URI
, andOPENAI_API_KEY
are correctly set in the hosting environment.
- Ensure the environment variables
This project is licensed under the MIT License.
- Author Name - Spectra.codes
- Creator Name - DRIX10
Why only generate Code? When you can generate the whole Repository!