A modern, feature-rich Discord modmail bot that enables private communication between users and staff through a ticket system.
- 🎫 Automatic Ticket Creation: Creates private channels when users DM the bot
- 💬 Two-way Communication: Seamless communication between users and staff
- 📎 Attachment Support: Handles file attachments in both directions
- 🔒 Secure Channels: Private channels with proper permission management
- 🎨 Rich Embeds: Beautiful embeds for ticket creation and management
- ⚡ TypeScript: Built with TypeScript for better type safety and maintainability
modmail-bot/
├── src/
│ ├── commands/ # Bot commands
│ ├── config/ # Configuration files
│ ├── events/ # Event handlers
│ ├── types/ # TypeScript type definitions
│ ├── utils/ # Utility functions and classes
│ └── index.ts # Main entry point
├── .env # Environment variables (create this)
├── package.json # Project dependencies
└── tsconfig.json # TypeScript configuration
- Node.js 16.x or higher
- A Discord bot token
- A Discord server with appropriate permissions
- Clone the repository:
git clone https://github.com/vtuberstv/modmail-bot.git
cd modmail-bot- Install dependencies:
npm install- Create a
.envfile in the root directory:
BOT_TOKEN=your_bot_token_here
MAIN_GUILD_ID=your_guild_id_here
TICKET_CATEGORY_ID=your_category_id_here- Build the project:
npm run build- Start the bot:
npm startFor development with hot-reload:
npm run dev- DM the bot to create a new ticket
- The bot will create a private channel for staff to respond
- Continue the conversation in DMs with the bot
- When a user DMs the bot, a new channel is created in the specified category
- Staff can respond in the ticket channel
- Messages are automatically forwarded to the user
- Use
!closein the ticket channel to close the ticket
- Create new files in the appropriate directories
- Follow the existing code structure and patterns
- Add proper TypeScript types
- Update documentation as needed
- Create a test Discord server
- Set up a test bot token
- Use the development mode for testing changes
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.