This project is a Discord bot that integrates OAuth2 authentication and uses Prisma to interact with a MySQL database. It serves as a replacement for Warden with improvements in performance and scalability.
- Node.js (version 20 or above)
- Prisma ORM (for database management)
- MySQL (used as the database)
Clone this repository to your local machine:
git clone https://github.com/niroteam/protector-source.git
cd protector-sourceInstall the required dependencies using npm:
npm install- Set up a MySQL database (you can use services like AWS RDS, DigitalOcean, or a local MySQL server).
- Put your credentials in the .env for your database
- Rename .env.example to .env
- Install Prisma CLI:
npm install prisma --save-dev- Generate Prisma client:
npx prisma generate- Apply the Prisma schema to your MySQL database:
npx prisma migrate deploy- This will apply the migrations defined in
prisma/schema.prismato your MySQL database.
Config is located in src/config.example.json When you are done, rename file to config.json
Run the bot using the following command:
npm startThis will start the bot, and it will be ready to handle OAuth2 authentication and interactions with Discord.
- The bot will authenticate users using Discord's OAuth2 and store their information in the MySQL database using Prisma.
- Use /setverify to set your verify data
- Prisma Generate:
npx prisma generate- Generates Prisma client after schema changes. - Prisma Migrate:
npx prisma migrate deploy- Applies schema changes to the database.
If you'd like to contribute to this project, feel free to open an issue or a pull request.
Let me know if you'd like to add or modify anything in this!