# Project: Advanced Discord Community Bot
You are an expert Discord bot developer, backend engineer, and UI/UX designer. Your task is to build a complete, production-ready, all-in-one Discord community management bot.
The bot must have a professional identity, modular architecture, modern design, and fully functional features.
## Bot Identity
- Bot Name: MG Core
- Purpose: Complete community management, moderation, engagement, automation, and server administration.
- Platform: Discord
- Framework: Discord.js v14
- Language: JavaScript
- Database: MongoDB
## Main Goal
Build an all-in-one Discord bot that combines the functionality of popular bots like Dyno, Carl-bot, Sapphire, MEE6, Ticket Tool, and other community bots.
The bot must be easy to use through slash commands, buttons, dropdown menus, modals, and an optional web dashboard.
---
## FEATURES
### 1. Welcome & Leave System
- Custom welcome messages.
- Welcome embeds.
- Welcome images with customizable backgrounds.
- Member avatars.
- Server name and member count.
- Custom welcome channel.
- Optional welcome DM.
- Leave messages.
- Leave embeds.
- Custom goodbye images.
- Customizable message templates.
- Variables:
`{user}`, `{username}`, `{userid}`, `{server}`, `{membercount}`.
- Enable/disable individual features.
### 2. Moderation
Implement:
- `/ban`
- `/unban`
- `/kick`
- `/timeout`
- `/untimeout`
- `/warn`
- `/warnings`
- `/clearwarnings`
- `/purge`
- `/slowmode`
- `/lock`
- `/unlock`
- `/hide`
- `/unhide`
- `/nickname`
- `/modlogs`
- `/massrole`
Include:
- Moderation reason.
- Case IDs.
- Moderation logs.
- Warning escalation.
- Configurable punishment system.
- Permission checks.
- Role hierarchy checks.
- Confirmation prompts for dangerous actions.
### 3. Auto Moderation
- Spam detection.
- Message flood protection.
- Duplicate message detection.
- Excessive mention detection.
- Bad word filter.
- Discord invite filtering.
- Link filtering.
- Emoji spam detection.
- Caps spam detection.
- Configurable punishments.
- Exempt roles.
- Exempt channels.
- Automod configuration commands.
- Moderation logs.
### 4. Autoroles
- Automatically assign roles to new members.
- Multiple autoroles.
- Delayed role assignment.
- Bot hierarchy validation.
- Temporary roles.
- Role assignment logs.
- Self-role panels.
- Button roles.
- Dropdown roles.
- Reaction roles.
### 5. Tickets
Create a fully functional ticket system:
- Ticket creation panels.
- Multiple ticket categories.
- Support tickets.
- Partnership tickets.
- Report tickets.
- Staff applications.
- Private ticket channels.
- Ticket claiming.
- Add/remove members.
- Ticket closing.
- Ticket reopening.
- Ticket transcripts.
- Ticket logs.
- Close reason.
- Staff role configuration.
- Ticket statistics.
### 6. Leveling
- Message-based XP.
- XP cooldown.
- Anti-spam protection.
- Level-up announcements.
- Custom level-up messages.
- Rank cards.
- `/rank`
- `/level`
- `/leaderboard`
- XP multipliers.
- Level rewards.
- Role rewards.
- Configurable XP system.
- Server-specific leveling settings.
### 7. Logging
Separate logging channels for:
- Member joins.
- Member leaves.
- Message edits.
- Message deletions.
- Role changes.
- Channel creation.
- Channel deletion.
- Voice activity.
- Bans.
- Unbans.
- Moderation actions.
- Nickname changes.
- Ticket activity.
- Invite tracking.
- Server updates.
### 8. Invite Tracking
- Track member invitations.
- Invite counts.
- Invite leaderboard.
- Invite rewards.
- Fake invite detection where possible.
- Bonus invites.
- Invite milestones.
- `/invites`
- `/inviteinfo`
- `/inviteleaderboard`
### 9. Giveaways
- Create giveaways.
- Custom prizes.
- Duration.
- Winner count.
- Button-based entry.
- Reroll winners.
- Giveaway ending notifications.
- Multiple simultaneous giveaways.
- Giveaway logs.
- Optional role requirements.
### 10. Suggestions
- Suggestion submission.
- Voting.
- Approve/reject buttons.
- Suggestion status.
- Staff responses.
- Suggestion logs.
- Anonymous suggestion option.
- Suggestion statistics.
### 11. Utility
Implement:
- `/userinfo`
- `/serverinfo`
- `/avatar`
- `/banner`
- `/roleinfo`
- `/channelinfo`
- `/botinfo`
- `/ping`
- `/uptime`
- `/membercount`
- `/poll`
- `/embed`
- `/say`
- `/afk`
- `/remind`
- `/emoji`
- `/calculator`
### 12. Community Features
- Daily rewards.
- Currency.
- Economy.
- Shop.
- Buyable roles.
- Profile customization.
- Achievements.
- Streaks.
- Fun commands.
- Games.
- Interactive community events.
### 13. Anti-Raid Protection
- Join flood detection.
- Anti-spam.
- Anti-bot protection.
- Mass mention detection.
- Raid lockdown.
- Suspicious account detection.
- Verification system.
- CAPTCHA integration if possible.
- Quarantine roles.
- Security alert logs.
- Configurable security levels.
### 14. Custom Commands
- Create custom commands.
- Text responses.
- Embed responses.
- Variables.
- Command aliases.
- Role restrictions.
- Channel restrictions.
- Custom cooldowns.
- Enable/disable commands.
### 15. Starboard
- Star reactions.
- Configurable star threshold.
- Custom star emoji.
- Starboard channel.
- Automatic updates.
- Excluded channels.
- Excluded roles.
### 16. Voice Channels
- Join-to-create channels.
- Temporary voice channels.
- Custom channel names.
- Channel owner controls.
- User limits.
- Lock/unlock.
- Rename.
- Transfer ownership.
- Automatic cleanup.
---
# WEB DASHBOARD
If possible, create a modern web dashboard.
### Dashboard Features
- Discord OAuth2 authentication.
- Server selection.
- Server overview.
- Member statistics.
- Bot statistics.
- Welcome configuration.
- Leave configuration.
- Autorole management.
- Moderation configuration.
- Ticket configuration.
- Leveling configuration.
- Logging configuration.
- Giveaway management.
- Reaction role management.
- Automod configuration.
- Custom commands.
- Server settings.
### Design
- Modern dark UI.
- Premium appearance.
- Responsive design.
- Sidebar navigation.
- Blue/purple accent colors.
- Smooth animations.
- Clean cards.
- Toggle switches.
- Interactive forms.
- Live configuration updates.
---
# TECHNICAL REQUIREMENTS
- Node.js.
- Discord.js v14.
- MongoDB.
- Modular architecture.
- Slash commands.
- Event handlers.
- Command handler.
- Database models.
- Configuration management.
- Environment variables.
- `.env.example`.
- Error handling.
- Logging.
- Permission checks.
- Cooldowns.
- Rate limits.
- Secure handling of secrets.
- Multi-server support.
- Persistent data.
- Reusable embeds.
- Buttons.
- Select menus.
- Modals.
- Proper interaction handling.
- Deployment instructions.
- README documentation.
## File Structure
Organize the project professionally:
- `src/commands`
- `src/events`
- `src/modules`
- `src/database`
- `src/utils`
- `src/config`
- `src/dashboard`
- `src/middleware`
- `src/services`
- `src/handlers`
Keep every feature separated into its own module.
---
# IMPORTANT DEVELOPMENT RULES
1. Do not create fake commands.
2. Do not leave commands unfinished.
3. Do not use placeholder functionality.
4. Every feature must actually work.
5. Every command must have proper permission validation.
6. Every database operation must be properly implemented.
7. Use proper error handling.
8. Make the bot compatible with multiple servers.
9. Never expose the bot token.
10. Never hardcode sensitive credentials.
11. Do not delete or break previously implemented features when adding new ones.
12. Test the code and fix errors before considering a module complete.
13. Keep the code readable and maintainable.
14. Explain how to install, configure, and run the bot.
## DEVELOPMENT PROCESS
First, inspect the existing project files and environment.
If a project already exists, modify it instead of recreating it unnecessarily.
Then proceed in phases:
**Phase 1:** Core bot, database, configuration, command/event handler.
**Phase 2:** Welcome, goodbye, autoroles, logging.
**Phase 3:** Moderation, automod, anti-raid.
**Phase 4:** Tickets, suggestions, reaction roles.
**Phase 5:** Leveling, invite tracker, giveaways.
**Phase 6:** Utility, economy, custom commands, starboard, voice.
**Phase 7:** Dashboard.
**Phase 8:** Testing, debugging, optimization, documentation.
Start with Phase 1. Create the actual project files and working code. Do not merely explain what you would do. Continue implementing the project systematically until all requested features are completed.