- π 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!