A professional Discord ModMail bot that allows users to privately message staff through direct messages.
- 📨 Direct Message Support: Users can create tickets by sending a direct message to the bot
- 📝 Logging: Complete message logs for administrative purposes
- 📊 Statistics: Track ticket metrics and usage
- 🛠️ Easy Setup: Simple setup process with automatic configuration
- 🔄 MongoDB Integration: Persistent ticket storage
- 🌐 Multi-Server Support: Supports multiple servers with server selection for users
- 🎫 Multi-Ticket Management: Allows users with tickets in multiple servers to select where to send messages
- Node.js (v16.11.0 or higher)
- MongoDB account and database
- Discord Bot Token
-
Clone the repository
git clone https://github.com/IzzyTheBuilder/modmail-coders-planet cd modmail-coders-planet -
Install dependencies
npm install
-
Configure environment variables Copy the
.env.examplefile to a new file called.envand fill in the required information:cp .env.example .env
Edit the
.envfile with your details:TOKEN=your_discord_bot_token_here MONGODB_URI=your_mongodb_connection_uri_here CLIENT_ID=your_bot_client_id_here PREFIX=! -
Deploy slash commands
npm run deploy
This will register your commands with Discord and automatically remove any old commands that no longer exist in your code.
-
Start the bot
npm start
Running
npm startwill automatically deploy commands before starting the bot, ensuring your commands are always up to date.You can also enable automatic command deployment on startup by setting
AUTO_DEPLOY_COMMANDS=truein your.envfile.
- Invite the bot to your server with the proper permissions
- Run the
/setupcommand in your server (admin only) - The bot will automatically:
- Create a MODMAIL category (or use existing one)
- Create a log channel (or use existing one)
- Set up or use an existing Staff role
- Save all configuration to the database
- Send a direct message to the bot to create a ticket
- If you're in multiple servers with this bot, you'll be prompted to select which server to create a ticket in
- Continue sending messages to communicate with the staff
- If you have tickets in multiple servers, you'll be prompted to choose which ticket to reply to
- When a user creates a ticket, a channel will be created in the ModMail category
- Type in the channel to respond to the user
- Use slash commands for additional functionality:
/close [reason]- Close the current ticket/stats- View ticket statistics/help- Get help information
The bot's behavior can be customized by editing the src/config/config.js file:
- Change the embed colors
- Modify message footer text
- Adjust cooldown periods
- Toggle ticket features
All server-specific configuration (like channels, roles, etc.) is automatically managed in the database, so you don't need to manually configure IDs in environment variables.
This project is licensed under the MIT License - see the LICENSE file for details.
This Discord ModMail bot was created by Izzy | Coders Planet
Join our Discord community: Coders Planet
If you encounter any issues or have questions, please open an issue on the GitHub repository.
Made with ❤️ by Izzy | Coders Planet