mod-bot
mod-bot copied to clipboard
discord.js v13 moderation bot w/mongoDB
Thanks to JetBrains for providing me free license for developing this project!
Features
- Multi guild!
- Warn members
- Add and remove bot moderators
- Manage guild members
- Log everything
- Much more!
Contributing
- Want to contribute? Feel free to make any changes you want
- Fork or clone the repo
- Make any changes you want (You can also see
todofile) - Open a pull request explaining what changes you've made
- I (el bkr) will review it and accept it :D
Installation
Requirements
- Node v16 or higher
Getting the files
- GitHub CLI:
gh repo clone elbkr/mod-bot - Download and extract the zip
- Open with GitHub Desktop
Creating the application
- Create an application in Discord Developer Portal
- Create a BOT and Copy the BOT token
- Enable all privileged gateway intents
- Go to OAuth2 and copy the client ID
- Paste the token at
TOKENline and the client ID atCLIENT_IDline in.envfile - Change
REPLACE_THISin the URL below with the client ID, and enter the link in your browser
https://discord.com/api/oauth2/authorize?client_id=REPLACE_THIS&permissions=8&scope=applications.commands%20bot
Connecting to mongo DB
- Login or register into Mongo DB
- Create a cluster and complete the configuration
- Get the connection url by pressing on
connect < connect your application - Replace the
passwordwith your database access password - Paste the URL into
.envfile atMONGOline
The URL looks like this: mongodb+srv://username:[email protected]/MyFirstDatabase?retryWrites=true&w=majority
.ENV Output
After the configuration, the .env file should look like this:
TOKEN=SuPerReALToken.BelIeVe_Me_itS_ReaL
MONGO=mongodb+srv://username:[email protected]/MyFirstDatabase?retryWrites=true&w=majority
CLIENT_ID=521311050193436682
Running the BOT
- Open a terminal and run
npm installornpm i - Run
node .
Free hosting
- Local host
After the configuration, run
node .in the terminal (not recommended)- It turns off when you turn off the PC
- Heroku
- After the configuration, add the files to a GitHub repository
- Login or register in Heroku
- Create a new app
- In
deploysection, pressConnect to GitHub - After connecting, search for the repository and press
connect - Press Enable automatic deploys (optional)
- Click Deploy Branch
- Go to
Resourcessection - Disable the
webtype and enableworkertype