mirror of
https://github.com/zenithpaws/Astral-Moderation-v2.git
synced 2025-12-15 01:18:55 +01:00
A Discord moderation bot that's meant to be simple, customizable, and easy to use!
discord
discord-bot
firebase
firebase-database
moderation-bot
moderation-discord-bot
nextcord
utility-bot
utility-discord-bot
|
|
||
|---|---|---|
| Flask | ||
| Previous Changelogs | ||
| .gitignore | ||
| bot.py | ||
| CHANGELOG 2-16-2025.md | ||
| LICENSE | ||
| README.md | ||
| requirements.txt | ||
Discord Bot
A powerful and customizable Discord bot built with Nextcord and integrated with Firestore for persistent data storage. This bot includes features for moderation, utility commands, and automated server management.
Features
- Moderation Tools: Manage bans, kicks, warns, and mutes.
- Utility Commands: Announcements, message purging, role management, and more.
- Automated Events: Welcome and leave messages with configurable settings.
- Persistent Configuration: Store roles, channels, and settings in Firestore.
- Slash Command Support: Modern and user-friendly Discord commands.
Setup and Configuration
Prerequisites
-
Python 3.8+
- Download and install Python from python.org.
-
Dependencies
- Install all required libraries using:
pip install -r requirements.txt
- Install all required libraries using:
-
Firebase Project Follow these steps to set up your Firestore database:
Step 1: Create a Firebase Project
- Go to the Firebase Console.
- Click on "Add Project".
- Enter a name for your project and follow the setup steps.
- Once created, navigate to your project dashboard.
Step 2: Enable Firestore Database
- In the Firebase Console, click on "Build" in the left sidebar, then select "Firestore Database".
- Click "Create Database" and follow the prompts.
- Choose Production Mode for security or Test Mode for easier initial setup.
Step 3: Generate Admin SDK Credentials
- Go to "Project Settings" in the Firebase Console (click the gear icon in the top left).
- Navigate to the "Service Accounts" tab.
- Click "Generate New Private Key". This will download a JSON file containing your Firebase Admin SDK credentials.
- Rename this file to
firebase.jsonand place it in the root directory of your project.
Step 4: Set Up Firestore Collections
- In the Firestore database, create the following collections and documents to store bot settings:
- Collection:
secrets- Document:
token- Field:
token(String) → Add your bot token here.
- Field:
- Document:
server_invite(Optional)- Field:
link(String) → Add your server invite link.
- Field:
- Document:
github_repo(Optional)- Field:
link(String) → Add your GitHub repository link.
- Field:
- Document:
- Collection:
roles- Document:
allowed_commands- Field:
examplerole1(Boolean) → true - Field:
examplerole2(Boolean) → true
- Field:
- Document:
- Collection:
Step 3: Test Your Firebase Connection
- Ensure the
firebase.jsonfile is accessible in your bot directory. - The bot will automatically connect to Firestore when run if the credentials are valid.
Bot Setup
-
Clone or Download
git clone https://github.com/zenithpaws/Astral-Moderation-v2 cd Astral-Moderation-v2 -
Add Firebase Credentials Place your
firebase.jsonfile in the root directory of the project. -
Configure Firestore
- Add the following keys to the Firestore database under the collection
secrets:token: Your bot token from the Discord Developer Portal.server_invite(optional): Your server's invite link.github_repo(optional): A link to your bot's GitHub repository.
- Add the following keys to the Firestore database under the collection
-
Run the Bot Execute the bot using:
python bot.py
Usage
Slash Commands
The bot supports a wide range of slash commands. Below are some highlights:
Moderation
/ban [member] [reason]- Ban a user./kick [member] [reason]- Kick a user./warn [member] [reason]- Issue a warning to a user./mute [member]- Mute a user./unmute [member]- Unmute a user.
Configuration
/setwarnthreshold [number]- Set the warning threshold./setmuterole [role]- Assign a role to muted members./setjoinchannel [channel]- Specify the channel for welcome messages.
Utility
/purge [amount]- Delete messages in a channel./invite- Retrieve the server's invite link.
General
/help- View a list of all available commands.
Directory Structure
├── bot.py # Main bot script
├── firebase.json # Firebase Admin SDK credentials
├── requirements.txt # Python dependencies
├── Flask/
│ └── pid.txt # Stores the PID of the running bot
Requirements
Install dependencies by running:
pip install -r requirements.txt
Contributing
Feel free to fork the repository, submit issues, or create pull requests. Contributions are always welcome!
License
This project is licensed under the MIT License.
Additonal Notes
- Only setup the collections and documents in these instructions, other fields needed for storing settings and info are created when you set them using the bot's commands
- When setting up the
allowed_commandsdocument inrolescollection, don't specifiy roles that shouldn't be allowed to run commands, only specifiy the roles that should