Shard-ready Discord music bot powered by Rainlink, Lavalink, and Discord.js v14.
- Quick Start
- Main Features
- Requirements
- Command Overview
- Environment Variables
- Configuration Notes
- Installation (Local)
- Installation (Docker)
- Permissions Needed
- Troubleshooting
- Contributing
- Contributors
- Support the Project
- Bots Using This Source Code
- License
- Clone and install:
git clone https://github.com/adh319/Lunox.git
cd Lunox
npm install- Create env file:
cp .env.example .envWindows PowerShell:
Copy-Item .env.example .env- Fill all required keys in
.env(TOKEN,MONGO_URI, Lavalink connection values, etc). - Add your dev ID in
src/settings/config.js. - Start MongoDB + Lavalink.
- Run the bot:
npm start- βοΈ Discord.js v14 +
discord-hybrid-shardingarchitecture (auto shard/cluster mode) - βοΈ Rainlink Lavalink client with configurable drivers (
v3/v4) and voice plugin enabled - βοΈ Full slash command music suite: play, queue, loop, filter, seek, volume, etc.
- βοΈ Interactive now-playing controller with buttons (pause/resume, volume, loop, shuffle, previous, skip, stop)
- βοΈ Queue pagination with button-based navigation
- βοΈ 24/7 mode (
/247) with reconnect persistence per guild - βοΈ Autoplay toggle (
/autoplay) with YouTube-only fallback behavior - βοΈ Per-user ban system and maintenance mode (dev prefix commands)
- βοΈ MongoDB-backed guild/user state with periodic sync
- βοΈ Lyrics lookup for current song (
/lyric) - βοΈ Auto-leave timeout when inactive/alone (configurable)
- Node.js 18+ (LTS) (Download / Docs)
- MongoDB 5+ (MongoDB Community Download)
- Lavalink server (Lavalink Docs)
- Java 17+ (LTS) (OpenJDK Downloads) (if you run your own Lavalink)
- Discord bot token (Discord Developer Portal Guide)
| Group | Commands |
|---|---|
| General | /help, /ping |
| Music | /play, /queue, /skip, /previous, /pause, /resume, /stop, /seek, /remove, /clear, /shuffle, /loop, /filter, /volume, /join, /leave, /lyric |
| Settings | /247, /autoplay |
ban,unban,maintenance,lavalink,eval,restart- Loaded from
src/commands/message/dev - Intended for developer/admin use only (requires your Discord user ID in
devarray insrc/settings/config.js)
Create a .env file from .env.example.
| Key | Default | Purpose |
|---|---|---|
TOKEN |
- | Discord bot token |
PREFIX |
! |
Prefix for dev message commands |
EMBED_COLOR |
5865F2 |
Embed hex color (without #) |
LEAVE_TIMEOUT |
60000 |
Inactivity timeout before leaving VC (ms) |
DEFAULT_VOLUME |
100 |
Initial player volume |
MIN_VOLUME |
1 |
Minimum volume |
MAX_VOLUME |
100 |
Maximum volume |
MONGO_URI |
- | MongoDB connection string |
SUPPORT_SERVER_URL |
- | Support button URL |
DEBUG |
false |
Enable debug logs when true |
| Key | Default | Purpose |
|---|---|---|
LAVALINK_NAME |
Lunox |
Node name |
LAVALINK_HOST |
localhost |
Lavalink host |
LAVALINK_PORT |
2333 |
Lavalink port |
LAVALINK_PASSWORD |
youshallnotpass |
Lavalink password |
LAVALINK_SECURE |
false |
Use secure connection (true / false) |
LAVALINK_DRIVER |
lavalink/v4/koinu |
Rainlink driver for your Lavalink version |
| Key | Default | Purpose |
|---|---|---|
LAVALINK_SOURCE |
sp |
Source ID used for /play search |
DEFAULT_SEARCH_ENGINE |
youtubeMusic |
Primary search engine |
SEARCH_FALLBACK_ENGINE |
youtube |
Fallback search engine |
Notes:
- Spotify/Apple/Deezer/Others source support depends on your Lavalink plugins and Lavalink server configuration.
Edit src/settings/config.js:
dev: ["123456789012345678"],These IDs can access developer-only flows and bypass maintenance lock.
Customize player and pagination emojis in src/settings/emoji.js.
LAVALINK_SOURCE should match source IDs enabled in Lavalink.
Examples:
yt-> YouTube search (ytsearch)ytm-> YouTube Music search (ytmsearch)sc-> SoundCloud search (scsearch)sp-> Spotify search (spsearch) when plugin/source is enabledam-> Apple Music search (amsearch) when plugin/source is enableddz-> Deezer search (dzsearch) when plugin/source is enabled
Use only IDs supported by your Lavalink server/plugins.
LavaSrc reference (supported URLs & queries): https://github.com/topi314/LavaSrc?tab=readme-ov-file#supported-urls-and-queries
- Clone repository:
git clone https://github.com/adh319/Lunox.git
cd Lunox- Install dependencies:
npm install- Configure environment:
cp .env.example .envWindows PowerShell:
Copy-Item .env.example .env- Fill all required keys in
.env - Configure developer IDs in
src/settings/config.js - Start Lavalink + MongoDB
- Start the bot:
npm startThis repository includes:
Dockerfilefor the bot imagedocker-compose.ymlfor bot + MongoDB
- Lavalink is external in current compose setup.
- Set
LAVALINK_HOSTto your Lavalink host (host.docker.internalis used as compose default).
docker compose up -d --builddocker compose downAt minimum, ensure the bot can:
ViewChannelSendMessagesEmbedLinksReadMessageHistoryConnectSpeak
For stage channels, also allow:
RequestToSpeakPrioritySpeaker
- Bot offline: verify
TOKENand intents in Discord Developer Portal - No music playback: verify Lavalink host/port/password/driver and Java/Lavalink logs
- Autoplay not working: autoplay currently depends on YouTube track context
- Leaves VC too quickly: increase
LEAVE_TIMEOUTor enable/247 - No DB persistence: verify
MONGO_URIconnectivity - Missing debug output: set
DEBUG=true
If you find Lunox useful, consider supporting continued development:
- GitHub Sponsors β https://github.com/sponsors/adh319
- PayPal β https://paypal.me/LunoxBot
- Ko-fi β https://ko-fi.com/lunoxbot
If you're using this source code and want your bot listed below, submit a pull request by editing the table with your details:
| No. | Bot Name | Invite Link | Support Server |
|---|---|---|---|
1 |
Jive | Invite Link | Jive Corner |
2 |
Xyvo | Invite Link | Xyvo |
3 |
|||
4 |
Contributions are welcome.
- Read CONTRIBUTING.md for contribution flow and standards.
- Open an issue before major changes.
- Keep pull requests focused and clearly described.
This project is licensed under the MIT License.
You are free to use and modify the code, but include attribution to the original repository:
Β© 2024 adh319@github. This project is available under the MIT License.
You must include proper attribution by linking to: https://github.com/adh319/Lunox
Made by adh319
Lunox Discord Music Bot β’ Built for Excellence