A Discord bot for managing user registration, server creation, and administration for a Pterodactyl panel. Users can register via email OTP, create servers, and manage their panel accounts directly from Discord.
- User Registration: Register with email verification and OTP.
- Server Creation: Create servers with resource tiers (Free/Premium) and select from Node.js, Python, or Java eggs.
- Account Management: Login, delete account, and view slot usage.
- Admin Tools: Delete all servers, modify server resources, delete ticket channels, and more.
- Role Sync: Automatically assign roles based on server ownership.
- Slot Announcements: Notifies users when server slots are available.
- Cost Analysis: Estimate monthly costs for custom server specs.
/register <email>– Register a new panel account./login– Get your panel login details./create <egg> <servername>– Create a new server./delete <serverid>– Delete one of your servers./deleteaccount– Delete your panel account and all servers./slots– Show current usage vs. max slots for each tier./costanalysis– Estimate monthly cost for custom resources./deletetickets– (Admin) Delete all ticket channels in the specified category./deleteall– (Admin) Delete all servers except whitelisted ones./modify– (Admin) Modify resources for all non-premium, non-whitelisted servers./ping– Check bot latency.
- Node.js v18+
- MongoDB database
- A Pterodactyl panel with API access
- A Discord bot token
-
Clone the repository:
git clone <your-repo-url> cd Pterodactyl-Discord-Manager
-
Install dependencies:
npm install
-
Configure settings:
- Copy
settings.jsand fill in your credentials:- Discord bot token
- MongoDB connection string
- Admin Discord user ID
- Ticket category ID
- Pterodactyl panel URL and API keys
- Copy
-
Configure SMTP for email verification:
- Edit
src/structures/sendVerificationEmail.jsand set your SMTP credentials.
- Edit
-
Start the bot:
npm start
src/commands/– All bot commands (Panel and Misc).src/events/– Discord event handlers.src/models/– Mongoose models for users.src/structures/– Utility classes and API wrappers.settings.js– Main configuration file.
- Only the admin (set in
settings.js) can use destructive commands like/deletetickets,/deleteall, and/modify.