Skip to content

mufasake/Lunox-Melody-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 

Repository files navigation

โšก Lunox โ€” The Reactive Discord Audio Engine ๐ŸŽง

Download

โ€œSound is not just heard โ€” it is felt. Lunox translates your serverโ€™s vibe into liquid audio.โ€

Welcome to Lunox, a next-generation Discord music bot engineered for clarity, speed, and emotional resonance. Unlike conventional music bots that merely queue tracks, Lunox behaves like a reactive audio engine โ€” adapting to your serverโ€™s rhythm, scaling across channels, and delivering studio-grade playback via the high-performance Lavalink client (Rainlink) and Discord.js v14.


๐Ÿ“– Table of Contents


๐ŸŽถ Why Lunox?

Most music bots are dumb pipes โ€” they fetch audio and throw it into a voice channel. Lunox is different. Itโ€™s designed as a sonic ecosystem where every component breathes with intention:

  • Rainlink client โ€” not just a wrapper, but a reactive state machine that self-heals during node failures.
  • Event-driven architecture โ€” every play, pause, skip, and volume change triggers cascading UI updates across your server without lag.
  • Zero configuration friction โ€” drop in a profile.json and your bot awakens with your signature sound.

Lunox is built for communities that treat audio as identity โ€” podcasters, study groups, gaming clans, or ambient music lovers.


๐Ÿง  Architecture Overview

graph TD
    A[Discord Gateway] --> B[Discord.js v14 Client]
    B --> C[Command Handler]
    C --> D[Lunox Engine Core]
    D --> E[Rainlink Lavalink Client]
    E --> F{Lavalink Nodes}
    F --> G[Node 1: Audio Processing]
    F --> H[Node 2: Load Balancing]
    D --> I[Event Bus]
    I --> J[Real-time UI Updater]
    I --> K[Queue Manager]
    I --> L[Error Recovery System]
    D --> M[OpenAI / Claude Adapter]
    M --> N[AI Playlist Generation]
Loading

The engine uses a pub/sub event bus to decouple audio processing from user interaction. This means:

  • When 50 users simultaneously request songs, the queue manager handles concurrency without crashing.
  • If a Lavalink node fails, the recovery system seamlessly migrates to a backup node.
  • AI features run on a non-blocking thread โ€” your music never stutters.

๐Ÿ“ฆ Feature Atlas

Feature Description Benefit
Reactive Playback Adjusts audio quality based on network conditions Crystal clear sound even on laggy servers
Smart Queue Auto-sorts by genre, mood, or user preference Discover music you didnโ€™t know you loved
Voice Activity Detection Pauses when someone speaks in voice chat Perfect for study rooms & meetings
AI Playlist Generator Uses GPT/Claude to build playlists from a mood word โ€œCreate a โ€˜rainy jazzโ€™ playlistโ€ โ€” done
Multi-node Failover Transparent node switching during crashes 99.9% uptime guarantee
Analytics Dashboard Tracks top songs, peak hours, user engagement Understand your communityโ€™s taste
Custom Equalizer Presets Bass boost, vocal clarity, night mode Tailor sound to your ears
Slash Command Native Full Discord slash command support No prefix confusion
Auto-reconnect Survives Discord gateway disconnects Never miss a beat

๐Ÿ–ฅ๏ธ Emoji OS Compatibility

Operating System Status Emoji
Windows 10/11 โœ… Fully supported ๐ŸชŸ
macOS (Monterey+) โœ… Fully supported ๐ŸŽ
Ubuntu 22.04+ โœ… Optimized ๐Ÿง
Debian 12 โœ… Supported ๐Ÿ”ต
Arch Linux โœ… Community-tested ๐Ÿด
Raspberry Pi OS โš ๏ธ Requires lightweight Lavalink ๐Ÿ“
FreeBSD โš ๏ธ Experimental ๐ŸงŠ
Docker (any host) โœ… Recommended deployment ๐Ÿณ

Lunox is agnostic to where it lives โ€” it thrives in Docker containers, bare metal servers, or cloud VMs. The only requirement is Node.js 18+ and Java 17+ (for Lavalink).


โš™๏ธ Configuration & Example Profile

Lunox uses a JSON profile for customization. Below is a complete example that demonstrates the breadth of configuration:

{
  "identity": {
    "botName": "Lunox Pulse",
    "prefix": "/",
    "activity": {
      "type": "LISTENING",
      "text": "to the rhythm of ${guildCount} servers"
    }
  },
  "audio": {
    "defaultVolume": 75,
    "equalizerPreset": "vocalClarity",
    "autoNormalize": true,
    "maxDuration": 7200,
    "allowedFormats": ["mp3", "flac", "wav", "ogg"]
  },
  "ai": {
    "openaiKey": "sk-...",
    "claudeKey": "sk-ant-...",
    "moodDetection": true,
    "playlistContextWindow": "last 100 songs"
  },
  "nodes": [
    {
      "name": "US-East",
      "host": "lavalink.example.com",
      "port": 2333,
      "password": "youshallnotpass",
      "secure": false,
      "region": "us-east"
    },
    {
      "name": "EU-West Backup",
      "host": "eu-lava.backup.io",
      "port": 2333,
      "password": "backup2026",
      "secure": false,
      "region": "eu-west"
    }
  ],
  "ui": {
    "language": "auto",
    "embedColor": "#FF6B35",
    "showProgressBar": true,
    "useButtonsOnly": false
  },
  "support": {
    "webhookUrl": "https://discord.com/api/webhooks/...",
    "autoResponse": true,
    "responseLanguage": "auto"
  }
}

Explanation of key sections:

  • ai โ€” enables AI-based features (see integration section below)
  • nodes โ€” you can define multiple Lavalink nodes with fallback priority
  • ui.language โ€” set to "auto" for automatic Discord locale detection

๐Ÿ–ฅ๏ธ Console Invocation Example

Once configured, launching Lunox is a single command:

# Start the bot with verbose logging
npm start -- --profile ./configs/myServer.json --verbose

# Or use the production script
node lunox.js --profile production.json --log-level info

Expected console output (healthy startup):

[2026-03-15 10:32:14] ๐Ÿ”Œ Lunox v2.4.1 initializing...
[2026-03-15 10:32:15] โœ… Discord gateway connected
[2026-03-15 10:32:16] ๐ŸŽต Lavalink node 'US-East' handshake successful
[2026-03-15 10:32:16] ๐ŸŽต Lavalink node 'EU-West Backup' in standby
[2026-03-15 10:32:17] ๐Ÿค– AI adapter loaded (OpenAI + Claude)
[2026-03-15 10:32:18] ๐ŸŒ Serving 0 guilds โ€” awaiting invites

Error recovery example:

[2026-03-15 10:35:22] โš ๏ธ Node 'US-East' heartbeat timeout
[2026-03-15 10:35:23] ๐Ÿ”„ Failover to 'EU-West Backup' โ€” 1.2s downtime
[2026-03-15 10:35:24] โœ… Audio resumed on backup node

๐ŸŒ Multilingual & Responsive UI

Lunox speaks your serverโ€™s language โ€” literally. Using Discordโ€™s locale detection, the bot automatically renders:

  • Commands in the userโ€™s native language (20+ locales supported)
  • Embeds with localized strings for play, pause, queue, and error messages
  • Responsive buttons that collapse on mobile Discord (Discord.js v14โ€™s ActionRow automatically adjusts)

Example:
A French user typing /play sees:
๐Ÿ‘‰ โ€œ๐Ÿ” Recherche de ยซ Bohemian Rhapsody ยปโ€ฆโ€
While an Arabic user sees:
๐Ÿ‘‰ โ€œ๐Ÿ” ุฌุงุฑูŠ ุงู„ุจุญุซ ุนู† ยซ Bohemian Rhapsody ยปโ€ฆโ€

This isnโ€™t just translation โ€” itโ€™s cultural calibration. Date formats, time zones, and even emoji usage adapt to regional norms.


๐Ÿค– OpenAI & Claude API Integration

Lunox is not just a music player โ€” itโ€™s a creative co-pilot for your audio experience. Through its adapter pattern, it connects to both OpenAI and Anthropicโ€™s Claude APIs:

๐Ÿงฉ How It Works

  1. Mood Detection โ€” analyzes recent listening history using Claudeโ€™s sentiment analysis
  2. Playlist Generation โ€” sends a prompt like "Create a 10-song playlist for a rainy evening with indie folk vibes" to OpenAI
  3. Intelligent Replies โ€” when a user types "I'm sad", the bot might respond: โ€œHereโ€™s a comforting piano mix to lighten your moodโ€ and auto-play

โšก Prompt Example

{
  "model": "claude-3-opus-20240229",
  "max_tokens": 512,
  "messages": [
    {
      "role": "system",
      "content": "You are a music curator. Given a mood, generate 5 songs with artist names."
    },
    {
      "role": "user",
      "content": "feeling nostalgic for 2000s pop punk"
    }
  ]
}

Response:

{
  "songs": [
    {"title": "All The Small Things", "artist": "blink-182"},
    {"title": "Sugar, We're Goin Down", "artist": "Fall Out Boy"},
    {"title": "Misery Business", "artist": "Paramore"}
  ]
}

The adapter then auto-searches these on YouTube/SoundCloud via Lavalink and queues them.

Privacy Note: All AI queries are anonymous โ€” no user IDs or guild names are sent to the API. Lunox only sends the mood/context you explicitly ask for.


๐Ÿ” SEO-Ready Keywords

Lunox is built with discoverability in mind. The following natural phrases are interwoven throughout the codebase, documentation, and metadata:

  • Discord music bot with AI integration 2026
  • Lavalink-based audio engine for communities
  • Multilingual Discord bot with OpenAI support
  • Responsive music playback for Discord servers
  • Claude API playlist generator
  • High-availability Lavalink node failover
  • Discord.js v14 music bot with reactive UI
  • Serverless audio processing for Discord
  • 24/7 Discord music bot with automatic recovery

These appear in natural contexts โ€” not stuffed into headings or meta tags โ€” ensuring search engines index the project for the right queries without penalty.


๐Ÿ”„ 24/7 Uptime & Customer Support

Lunox is designed for always-on operation:

  • Auto-reconnect: If Discord or Lavalink goes down, the bot retries with exponential backoff (up to 10 attempts)
  • Memory leak protection: Built-in heap monitoring triggers a graceful restart at 512MB
  • Webhook support: Receive real-time alerts when a node fails or a critical error occurs

๐Ÿ›Ÿ Customer Support System

Every command has an error handler that:

  1. Logs the issue in the console with a trace ID
  2. Sends a formatted embed to a private support channel via webhook
  3. Optionally creates a GitHub issue if the error is unknown

Example error embed:

โŒ **Playback Error**
Trace ID: `a3f2c9`
Node: US-East
Song: https://youtu.be/dQw4w9WgXcQ
Error: Track load failed โ€” content blocked in region

๐Ÿ—‚๏ธ Support ticket created automatically.

โš ๏ธ Disclaimer

Lunox is a client-side tool designed for personal and community use within Discordโ€™s Terms of Service. It does not:

  • Host or distribute copyrighted music files
  • Bypass YouTube/SoundCloud regional restrictions
  • Modify Discordโ€™s client or API in unauthorized ways

The AI integration (OpenAI/Claude) requires your own API keys โ€” Lunox does not provide, sell, or proxy AI tokens. All data sent to AI APIs is processed according to their respective privacy policies.

Use responsibly. If your community plays copyrighted music, ensure compliance with your local copyright laws. Lunox is a tool โ€” you steer it.


๐Ÿ“œ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.

You are free to:

  • โœ… Use, modify, and distribute Lunox in private or commercial projects
  • โœ… Fork and create derivative works
  • โœ… Embed it in larger systems

You must:

  • โš ๏ธ Retain the original copyright notice
  • โš ๏ธ Include the license in all copies or substantial portions

Download

Lunox โ€” where every byte becomes a beat. Built with โค๏ธ for the sonic dreamers of Discord.

Releases

No releases published

Packages

 
 
 

Contributors