A feature-rich, high-performance Discord music bot built with Lavalink and Discord.js v2 Components
Features • Installation • Configuration • Usage • Support
- Multi-Platform Support: YouTube, SoundCloud, Spotify (links, text search, and playlists)
- High-Quality Audio: Optimized for smooth playback even on low-memory hosting (512MB+)
- Queue Management: Advanced queue system with shuffle, loop, and clear options
- Playlist Support: Create, save, and manage custom playlists
- Autoplay: Intelligent autoplay system for continuous music
- 24/7 Mode: Keep the bot in voice channels 24/7
- Music Cards: Beautiful custom-generated music cards with thumbnails
- Live Lyrics: Real-time synchronized lyrics display
- Track History: Automatic history tracking for played songs
- Multi-Language Support: 20+ languages available [ soon ]
- Interactive Controls: Button-based controls for easy music management
- Progress Tracking: Real-time progress bars and track information
- Visual Feedback: Professional embeds and status updates
- Error Handling: Graceful error handling with user-friendly messages
- Low-Memory Mode: Optimized for hosting environments with limited RAM (512MB+)
- Efficient Updates: Reduced update frequencies to minimize CPU/memory usage
- Smart Caching: Optimized thumbnail fetching with fallback systems
- Resource Management: Automatic cleanup and memory optimization
- Filter System: Multiple audio filters (bassboost, nightcore, karaoke, etc.)
- Volume Control: Precise volume adjustment (10-100%)
- Seek Functionality: Jump to specific positions in tracks
- Vote Skip: Democratic skip system for queue management
- Track Info: Detailed track information display
- Node.js: v16.0.0 or higher
- Discord Bot Token: Get one from Discord Developer Portal
- Lavalink Server: Self-hosted or use a public Lavalink node
- MongoDB Database: For playlist and history storage
- Spotify API (Optional): For Spotify support
git clone https://github.com/GlaceYT/PrimeMusic-Lavalink.git
cd PrimeMusic-Lavalinknpm installCreate a .env file in the root directory:
TOKEN=your_discord_bot_token_hereEdit config.js with your settings:
module.exports = {
TOKEN: "", // Leave empty if using .env file
language: "en",
ownerID: ["your_user_id_here"],
mongodbUri: "your_mongodb_connection_string",
spotifyClientId: "your_spotify_client_id", // Optional
spotifyClientSecret: "your_spotify_client_secret", // Optional
nodes: [
{
name: "GlaceYT",
password: "glace",
host: "us-01.strixnodes.com",
port: 8003,
secure: false
}
]
}In the Discord Developer Portal:
- Go to your bot application
- Navigate to Bot → Privileged Gateway Intents
- Enable:
- ✅ MESSAGE CONTENT INTENT
- ✅ SERVER MEMBERS INTENT
npm start| Option | Description | Default |
|---|---|---|
TOKEN |
Discord bot token | "" (use .env) |
language |
Default bot language | "en" |
ownerID |
Bot owner user IDs | [] |
mongodbUri |
MongoDB connection string | Required |
embedColor |
Embed accent color (hex) | "#1db954" |
activityName |
Bot activity text | "YouTube Music" |
activityType |
Activity type | "LISTENING" |
| Option | Description | Default |
|---|---|---|
lowMemoryMode |
Enable low-memory optimizations | true |
generateSongCard |
Generate custom music cards | true |
showVisualizer |
Show audio visualizer | false |
showProgressBar |
Show progress bar in embeds | false |
Configure your Lavalink nodes in the nodes array:
nodes: [
{
name: "NodeName",
password: "youshallnotpass",
host: "localhost",
port: 2333,
secure: false
}
]| Command | Description |
|---|---|
/play <song> |
Play a song from YouTube, SoundCloud, or Spotify |
/pause |
Pause the current track |
/resume |
Resume the paused track |
/skip |
Skip to the next song |
/stop |
Stop playback and clear queue |
/queue |
View the current queue |
/volume <1-100> |
Adjust playback volume |
/nowplaying |
Show current track information |
| Command | Description |
|---|---|
/shuffle |
Shuffle the queue |
/loop |
Toggle loop mode (track/queue) |
/seek <time> |
Jump to a specific time in the track |
/filters |
Apply audio filters |
/autoplay |
Toggle autoplay mode |
/24/7 |
Toggle 24/7 mode |
/playlist create <name> |
Create a custom playlist |
/playlist savequeue <name> |
Save current queue as playlist |
The bot supports 11 languages:
- 🇺🇸 English (en)
- 🇪🇸 Spanish (es)
- 🇫🇷 French (fr)
- 🇩🇪 German (de)
- 🇨🇳 Chinese Simplified (cn)
- 🇯🇵 Japanese (ja)
- 🇰🇷 Korean (ko)
- 🇷🇺 Russian (ru)
- 🇵🇹 Portuguese (pt)
- 🇸🇦 Arabic (ar)
- 🇻🇳 Vietnamese (vi)
Change language with: /language <language_code>
- YouTube - Videos, playlists, and search
- SoundCloud - Tracks and playlists
- Spotify - Tracks, albums, and playlists (requires API credentials)
This bot is optimized for low-memory hosting environments:
- Reduced Update Frequency: Progress updates every 15 seconds (instead of 5)
- Smart Card Generation: Music cards regenerate every 90 seconds
- Efficient Health Checks: Optimized monitoring intervals
- Memory Management: Automatic cleanup and resource optimization
- Fast Thumbnail Fetching: Direct YouTube URLs with fallback system
- Minimum: 512MB RAM, 1 CPU core
- Recommended: 1GB+ RAM, 2+ CPU cores
- Node.js: v16.0.0 or higher
PrimeMusic-Lavalink/
├── commands/ # Bot commands
│ ├── basic/ # Basic commands (help, ping, stats)
│ ├── music/ # Music commands (play, pause, skip)
│ ├── playlist/ # Playlist management
│ └── utility/ # Utility commands
├── events/ # Discord event handlers
├── languages/ # Language files
├── utils/ # Utility functions
│ ├── musicCard.js # Music card generator
│ └── ...
├── UI/ # UI assets (icons, colors)
├── config.js # Bot configuration
├── bot.js # Main bot file
├── player.js # Music player logic
├── lavalink.js # Lavalink connection manager
└── index.js # Entry point
- Check if bot has proper permissions
- Verify MESSAGE CONTENT INTENT is enabled
- Ensure bot is online and connected
- Verify Lavalink node is running and accessible
- Check node configuration in
config.js - Ensure bot has permission to join voice channels
- Bot will automatically use music icon placeholder
- Check internet connection for thumbnail fetching
- YouTube thumbnails are fetched automatically from track URI
- Enable
lowMemoryMode: truein config - Disable
showVisualizerif not needed - Consider using
generateSongCard: falsefor minimal memory usage
- Discord Server: Join Support Server
- Issues: GitHub Issues
- Author: GlaceYT
This project is licensed under the MIT License - see the LICENSE file for details.
- Created by: GlaceYT (Shiva)
- Lavalink: lavalink-devs/Lavalink
- Discord.js: discordjs/discord.js
- Riffy: Lavalink client library
⭐ Star this repository if you find it helpful!
Made with ❤️ by GlaceYT
