⚠️ OFFICIAL SOURCE CODE - This is the official, production-ready source code for Moosek Music Bot. Built by ryxu-xo, the creator of Euralink V4.
A professional, high-performance Discord music bot built with Discord.js v14 and Euralink V4. Features advanced music capabilities, slash commands, smart node switching, voice resilience, and a scalable architecture designed for production use.
- 🚀 Built by the Euralink Creator - Developed by ryxu-xo, the creator of the Euralink V4 library
- ⚡ High Performance - HTTP/2 support, connection pooling, and smart caching
- 🛡️ Production Ready - Comprehensive error handling, logging, and monitoring
- 🎵 Advanced Features - SponsorBlock, audio filters, lyrics, and more
- 🔧 Fully Customizable - Clean, modular codebase that's easy to extend
- 📊 Real-time Metrics - Built-in performance monitoring and health checks
- Multi-Platform Support: YouTube, Spotify, SoundCloud, and more
- Smart Source Detection: Automatically chooses the best source for your query
- Advanced Queue Management: Pagination, smart shuffle, and history tracking
- Audio Processing: Built-in filters, EQ, and effects
- Voice Resilience: Auto-recovery from disconnections and stuck tracks
- SponsorBlock Integration: Automatic ad and sponsor segment skipping
- Lyrics Support: Real-time lyrics display with synced timing
- Chapter Support: Automatic chapter detection and navigation
- Persistence: Auto-resume music after bot restarts
- Smart Node Switching: Automatic failover between Lavalink nodes
- Slash Commands: Modern Discord slash command interface
- Modular Architecture: Easy to add new commands and features
- Database Ready: SQLite with comprehensive schema for playlists and settings
- Professional Logging: Winston with structured logging and colored output
- TypeScript Support: Full TypeScript definitions available
- Node.js 16.0.0 or higher
- Discord Bot Token from Discord Developer Portal
- Lavalink Server (or use the provided public node)
-
Clone the repository
git clone https://github.com/ryxu-xo/moosek.git cd moosek -
Install dependencies
npm install
-
Set up environment variables
cp env.example .env
Edit
.envwith your configuration:DISCORD_TOKEN=your_bot_token_here CLIENT_ID=your_client_id_here GUILD_ID=your_guild_id_here # Optional for faster command registration
-
Start the bot
npm start
For development with auto-restart:
npm run dev
moosek/
├── src/
│ ├── commands/ # Slash commands
│ │ ├── music/ # Music-related commands
│ │ └── general/ # General commands
│ ├── events/ # Discord events
│ ├── handlers/ # Command and event handlers
│ ├── music/ # Music system (Euralink integration)
│ ├── database/ # Database management
│ ├── utils/ # Utility functions
│ ├── config/ # Configuration files
│ └── structure/ # Core bot structure
├── data/ # Database and persistence files
├── logs/ # Log files
├── index.js # Main entry point
├── package.json # Dependencies and scripts
└── README.md # This file
| Command | Description | Usage | Permission |
|---|---|---|---|
/play |
Play music from various sources | /play <query> [source] |
Everyone |
/search |
Advanced music search with filters | /search <query> [platform] [type] [limit] |
Everyone |
/pause |
Pause the current track | /pause |
DJ Role |
/resume |
Resume the paused track | /resume |
DJ Role |
/skip |
Skip current track(s) | /skip [amount] |
DJ Role |
/stop |
Stop music and clear queue | /stop |
DJ Role |
/queue |
Display the music queue with advanced controls | /queue [page] [filter] [sort] |
Everyone |
/volume |
Adjust volume (0-1000) | /volume <level> |
DJ Role |
/seek |
Seek to position in track | /seek <position> |
DJ Role |
/loop |
Set loop mode | /loop <none/track/queue> |
DJ Role |
/shuffle |
Shuffle the queue | /shuffle [type] |
DJ Role |
/lyrics |
Get lyrics for current track | /lyrics |
Everyone |
/nowplaying |
Show current track info | /nowplaying |
Everyone |
/clear |
Clear the music queue | /clear |
DJ Role |
/remove |
Remove a track from queue | /remove <position> |
DJ Role |
/move |
Move a track in queue | /move <from> <to> |
DJ Role |
Features:
- 🎵 Multi-platform support (YouTube, Spotify, SoundCloud, etc.)
- 🔍 Advanced search with platform filters and result limits
- 📋 Interactive queue with pagination, filtering, and sorting
- 🎛️ Professional controls for DJs and music enthusiasts
- 🎧 Audio processing with volume, seek, and loop controls
| Command | Description | Usage | Permission |
|---|---|---|---|
/help |
Show all available commands with interactive dropdown | /help |
Everyone |
/ping |
Check bot latency and response time | /ping |
Everyone |
/invite |
Get bot invite link with additional buttons | /invite |
Everyone |
/support |
Get support server link | /support |
Everyone |
/stats |
Show comprehensive bot statistics | /stats |
Everyone |
Features:
- 📊 Real-time statistics and performance metrics
- 🔗 Quick access links to invite, support, and GitHub
- 📈 Bot health monitoring with uptime and memory usage
- 🎯 Interactive help system with categorized commands
| Command | Description | Usage | Permission |
|---|---|---|---|
/dj set |
Set DJ role for this server | /dj set <role> |
Administrator |
/dj remove |
Remove DJ role configuration | /dj remove |
Administrator |
/dj list |
List current DJ settings | /dj list |
Everyone |
Features:
- 🎧 Role-based permissions for music control
- ⚙️ Server-specific configuration for DJ roles
- 👥 Flexible user management for DJ privileges
- 🔒 Secure permission system with administrator-only access
| Command | Description | Usage | Permission |
|---|---|---|---|
/serverinfo |
Show comprehensive server information | /serverinfo |
Everyone |
/userinfo |
Show detailed user information | /userinfo [user] |
Everyone |
/avatar |
Get user avatar with download options | /avatar [user] |
Everyone |
/uptime |
Show bot uptime and performance stats | /uptime |
Everyone |
/version |
Show bot version and system information | /version |
Everyone |
Features:
- 📊 Detailed server analytics with member counts and channels
- 👤 User profile information with join dates and roles
- 🖼️ Avatar management with multiple format options
- ⏱️ Performance monitoring with uptime and system stats
| Command | Description | Usage | Permission |
|---|---|---|---|
/admin settings |
View server-specific settings | /admin settings |
Administrator |
/admin reset |
Reset server settings to default | /admin reset |
Administrator |
/eval |
Execute JavaScript code (Developer only) | /eval <code> [async] [silent] |
Bot Owner |
Features:
- ⚙️ Server configuration management with detailed settings
- 🔄 Settings reset functionality for troubleshooting
- 🔧 Developer tools with full bot context access
- 🛡️ Owner-only security for sensitive operations
Developer Features:
- 🚀 Full bot context access in eval command
- ⚡ Async/await support for complex operations
- 🔇 Silent execution for background operations
- 📊 Execution time monitoring and error handling
The bot uses a comprehensive configuration system in src/config/config.js. Key settings include:
- Bot token and client ID
- Intents and partials configuration
- Guild-specific settings
- Node configuration and connection options
- Smart switching and failover settings
- Performance optimization options
- Default volume and audio settings
- Voice resilience configuration
- SponsorBlock and filter settings
- SQLite configuration
- Table schemas and relationships
- Data persistence options
- Create a new file in
src/commands/[category]/ - Export an object with
dataandexecuteproperties - The command will be automatically loaded
Example:
const { SlashCommandBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('example')
.setDescription('An example command'),
async execute(interaction, client) {
await interaction.reply('Hello World!');
}
};- Create a new file in
src/events/ - Export an object with
nameandexecuteproperties - The event will be automatically loaded
The bot includes a comprehensive database system for:
- Guild Settings: Prefix, music channels, DJ roles
- User Preferences: Volume, shuffle, lyrics display
- Playlists: Custom playlists with track management
- Music Statistics: Play tracking and analytics
- Bot Statistics: Performance and usage metrics
- Real-time performance metrics
- Music statistics tracking
- Error logging and reporting
- Health checks for Lavalink nodes
- Winston Logger: Structured logging with multiple levels
- Chalk Integration: Colored console output
- File Rotation: Automatic log file management
- Error Tracking: Comprehensive error reporting
- Node health and performance
- Player statistics and usage
- Memory and CPU usage
- Network latency and throughput
-
Bot not responding to commands
- Check if slash commands are registered
- Verify bot permissions in your server
- Check console logs for errors
-
Music not playing
- Ensure you're in a voice channel
- Check Lavalink node connectivity
- Verify bot has voice permissions
-
Database errors
- Check if the
data/directory exists - Verify SQLite permissions
- Check database file integrity
- Check if the
Logs are stored in the logs/ directory:
combined.log- All log levelserror.log- Error logs only
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow the existing code style
- Add JSDoc comments for new functions
- Test your changes thoroughly
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
- Discord.js - Discord API wrapper
- Euralink V4 - Lavalink wrapper by ryxu-xo
- Lavalink - Audio node system
- ryxu-xo - Creator and maintainer
- GitHub Issues: Report bugs or request features
- Discord Server: Join our community
- Documentation: Comprehensive guides
- GitHub: Watch for releases and updates
- Discord: Get notified of new features
- Top.gg: Vote and review the bot