diff --git a/.gitignore b/.gitignore
index f6b56e4..9929f2f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,16 +3,6 @@ storage/data
config.json
settings.json
remix-settings.json
-cmdUsage.md
-bot.js
-bin/
test_data/
*.code-workspace
-*old.js
-.ytcache/
-.yt_auth.json
-yt_auth.json
-visitor_data.json
-.moonlink/
-storage/recovery.json
-.idea/
\ No newline at end of file
+.idea/
diff --git a/README.md b/README.md
index 7b65dd6..1ce0f91 100644
--- a/README.md
+++ b/README.md
@@ -18,10 +18,10 @@
-
+
-
-
+
+
@@ -31,6 +31,7 @@
## Table of Contents
- [About The Project](#-about-the-project)
+- [How Audio Playback Works](#-how-audio-playback-works)
- [Features](#-features)
- [Getting Started (Users)](#-getting-started-users)
- [Commands](#-commands)
@@ -49,32 +50,59 @@
## About The Project
-Remix is a free and open-source music bot for [Fluxer](https://fluxer.app), built with [`@fluxerjs/core`](https://github.com/fluxerjs/core) and powered by [`moonlink.js`](https://github.com/ShadowLp174/moonlink.js) for seamless, high-quality audio streaming. It uses [`revoice.js`](https://www.npmjs.com/package/revoice.js) for LiveKit voice connections and audio playback, and [`@fluxerjs/voice`](https://github.com/fluxerjs/voice) for native voice channel integration alongside the Moonlink Lavalink proxy.
+Remix is a free and open-source music bot for [Fluxer](https://fluxer.app), built with [`@fluxerjs/core`](https://github.com/fluxerjs/core) for the Fluxer API and [`@fluxerjs/voice`](https://github.com/fluxerjs/voice) for LiveKit voice connections. Track search and streaming are handled by [`lavalink-client`](https://www.npmjs.com/package/lavalink-client) talking to a [NodeLink](https://github.com/PerformanC/NodeLink) audio node (Lavalink-compatible), and the bot publishes Opus audio to LiveKit as a participant — with a custom WebM/Opus pipeline (zero-re-encode passthrough and remux where possible).
We believe music features shouldn't be locked behind paywalls — **all commands on Remix are 100% free and always will be.**
---
+## How Audio Playback Works
+
+Understanding the pipeline helps when debugging or contributing:
+
+```
+%play → LavalinkManager.search() ──► NodeLink (track resolution only)
+ → Player queue → FluxerAudioBridge.play(voiceConnection, track)
+ ├─ /v4/trackstream → direct WebM/Opus passthrough (no re-encode)
+ ├─ /v4/loadstream → magic-byte sniffing:
+ │ • WebM (1A45DFA3) → passthrough to LiveKit
+ │ • OggS → OggDemuxer → WebMOpusMuxer (remux, no re-encode)
+ │ • raw PCM → OpusEncoder (opusscript / @discordjs/opus)
+ │ → WebMOpusMuxer → LiveKit
+ └─ conn.play() → @fluxerjs/voice LiveKit connection (bot publishes audio
+ as a LiveKit participant)
+```
+
+A few things worth knowing:
+
+- **No Lavalink players are created.** NodeLink is used for search and its REST stream/lyrics endpoints (`/v4/loadstream`, `/v4/trackstream`, `/v4/loadlyrics`); playback itself is pure LiveKit publishing.
+- **Seek / pause / resume** work by stopping the current stream and re-requesting it at an offset from NodeLink.
+- **Filters** (bassboost, nightcore, etc.) are applied server-side by NodeLink, so they take effect on the next track that starts.
+- **Volume** is applied client-side by the LiveKit connection (1–200).
+- Radio metadata (StreamTitle) is read with **ffprobe** (`ffprobe-static`).
+
+---
+
## Features
-- **High-quality audio playback** via moonlink.js (Lavalink proxy), revoice.js (LiveKit voice + MediaPlayer), and `@fluxerjs/voice`
-- **Multi-source search** — YouTube, Spotify, SoundCloud, Deezer, Apple Music, Tidal, and direct URL support
-- **24/7 mode** — keep the bot in a voice channel permanently, with auto-recovery on restart
-- **Session recovery** — active players and queues survive bot restarts and crash recovery
-- **Interactive emoji player** — reaction-based control panel with play, pause, skip, volume, shuffle, and more
-- **Lyrics** — fetch synced lyrics via NodeLink
+- **High-quality audio playback** — NodeLink streaming with a zero-re-encode WebM/Opus pipeline, published over LiveKit
+- **Multi-source search** — YouTube, YT Music, Spotify, SoundCloud, Deezer, Apple Music, Tidal, Bandcamp and 40+ more provider prefixes, plus direct URLs
+- **24/7 mode** — keep the bot in a voice channel permanently, with staggered auto-rejoin on boot and rejoin retries on connection loss
+- **Interactive emoji player** — reaction-based control panel with live progress, lyrics viewer, and a filter submenu
+- **Lyrics** — synced lyrics via NodeLink
- **Radio stations** — built-in support for custom radio streams with keyword-based search
-- **Last.fm integration** — auto-scrobble songs, play loved/top/recent tracks, love/unlove tracks, view top artists, and view your Last.fm profile
+- **Last.fm integration** — account linking, scrobbling, now-playing, play loved/top/recent/albums, whoknows, crowns, compare, leaderboards, and profiles
- **Autoplay** — automatically play similar tracks when the queue ends (powered by Last.fm)
- **Seek** — jump to a specific position in the current track
-- **Track options** — set custom start/end times per track (like old iTunes), great for album compilations and hidden tracks
+- **Track options** — set custom start/end times per track, great for album compilations and hidden tracks
- **Queue move** — reorder tracks by moving them to a different position
-- **Server settings** — per-guild configuration for prefix, volume, locale, 24/7 channels, and more
-- **Web dashboard** — optional browser-based control panel with Redis-backed sessions and Fluxer OAuth2 login
-- **Multi-language support** — available in English, Arabic, German, Kurdish (Sorani), and Brazilian Portuguese
+- **Audio filters** — bassboost, speed, nightcore and more (applied server-side by NodeLink)
+- **Server settings** — per-guild configuration (prefix, volume, locale, 24/7 channels, …) stored in MySQL
+- **Dashboard backend** — optional Redis-RPC backend that an external web frontend uses to monitor players and control playback remotely
+- **Multi-language support** — English, Arabic, German, Kurdish (Sorani), and Brazilian Portuguese
- **Configurable logging** — granular control over which log categories appear in the console
-- **Graceful shutdown** — saves active session state on SIGINT/SIGTERM for seamless reboot recovery
-- **Module system** — pluggable module architecture for extending bot functionality
+- **Graceful shutdown** — destroys players and closes MySQL/Redis/NodeLink sessions cleanly on SIGINT/SIGTERM/SIGUSR2
+- **Module system** — pluggable module architecture for extending bot functionality (`storage/modules.json`)
---
@@ -132,14 +160,13 @@ Below is the complete list of Remix's commands. The default prefix is `%`.
| `invite` | Get the bot invite link | `%invite` | `addbot`, `remix` |
| `support` | Get an invite to the support server | `%support` | `server` |
| `lastfm` | Link Last.fm, toggle scrobbling, view profile, love/unlove tracks, top artists, play tracks, leaderboard | `%lastfm link` / `%lastfm love` / `%lastfm artists` / `%lastfm lb` | `lf`, `lfm` |
+| `vote` | Check FluxerList voters for the bot | `%vote` | |
| `reload` | Reload commands or modules at runtime (owner) | `%reload` | |
| `servers` | List servers the bot is in (owner) | `%servers` | |
| `eval` | Evaluate JavaScript (owner only) | `%eval 1+1` | |
| `debug` | Debug voice connections and player state (owner) | `%debug voice` | |
| `test` | Show voice channel user counts (owner) | `%test` | |
----
-
## Self-Hosting The Bot
If you prefer to host Remix yourself, please note: **You must make it clear that your bot is an instance of Remix.** Change the bot's name and give credit in the bot's profile (e.g., *"Powered by [Remix](https://github.com/remix-bot/fluxer)"*).
@@ -152,13 +179,13 @@ The fastest way to self-host Remix is with Docker. Everything — the bot, MySQL
```bash
git clone https://github.com/remix-bot/fluxer.git
cd fluxer/docker
- cp .env.example .env
cp config_example.json config.json
+ cp .env.example .env # optional — compose has working defaults
```
-2. **Edit `.env`** — set your bot token and MySQL passwords.
+2. **Edit `config.json`** — fill in your bot token, MySQL credentials (defaults match the compose MySQL service), NodeLink details (defaults match the compose NodeLink service), and your owner IDs. Spotify/Deezer/Apple Music credentials are configured on the **NodeLink side** (`nodelink.config.json`), not in the bot config.
-3. **Edit `config.json`** — fill in your bot token, Fluxer OAuth2 credentials (if using the dashboard), and any other settings. The Docker config already points MySQL/Redis/NodeLink at the correct service hostnames.
+3. **Edit `.env`** (optional) — MySQL passwords, host port mappings (`WEB_PORT`, `NODELINK_PORT`), and timezone.
4. **Start everything:**
```bash
@@ -170,30 +197,30 @@ The fastest way to self-host Remix is with Docker. Everything — the bot, MySQL
docker compose logs -f bot
```
-That's it. The bot will start, connect to MySQL (auto-creates the settings table), connect to NodeLink, and log in to Fluxer.
+That's it. The bot will start, connect to MySQL (Last.fm and track-options tables are auto-created), connect to NodeLink, and log in to Fluxer.
#### Docker file structure
```
docker/
-├── Dockerfile # Multi-stage build (Node 22 + FFmpeg + tini)
-├── docker-entrypoint.sh # Config validation on first boot
+├── Dockerfile # Multi-stage build (Node 22 + tini, non-root user, healthcheck)
+├── docker-entrypoint.sh # Writes config.json from CONFIG_JSON env var on first boot
├── docker-compose.yml # bot + MySQL + Redis + NodeLink
+├── .env.example # Compose env template (MySQL creds, ports, TZ)
├── config_example.json # Docker-friendly config template
-├── .env.example # Secrets template
-├── nodelink.config.json # NodeLink audio node config
├── config.json # You create this (gitignored)
-└── .env # You create this (gitignored)
+├── .env # You create this (gitignored)
+└── nodelink.config.json # NodeLink audio node config
```
#### Docker services
| Service | Container | Port | Purpose |
| :--- | :--- | :--- | :--- |
-| `bot` | remix-bot | 8080 → 80 | The Remix bot + web dashboard |
-| `mysql` | remix-mysql | — | Per-guild settings storage |
-| `redis` | remix-redis | — | Dashboard sessions + pub/sub (optional) |
-| `nodelink` | remix-nodelink | 3000 | Lavalink-compatible audio node |
+| `bot` | remix-bot | `${WEB_PORT:-8080}` → 80 | The Remix bot (+ optional dashboard backend) |
+| `mysql` | remix-mysql | — | Settings, Last.fm users, and track options storage |
+| `redis` | remix-redis | — | Dashboard RPC pub/sub (optional) |
+| `nodelink` | remix-nodelink | `${NODELINK_PORT:-3000}` | Lavalink-compatible audio node |
#### Useful Docker commands
@@ -234,11 +261,10 @@ The entrypoint will write it to `/app/config.json` on first boot if no config fi
#### Prerequisites
-- **Node.js** >= 22.0.0 (required by moonlink.js v5)
+- **Node.js** >= 22.13.0
- **MySQL** 8.0+ with JSON column support
-- **[NodeLink](https://github.com/PerformanC/NodeLink)** instance (Lavalink proxy for audio)
-- **FFmpeg** (installed automatically via `ffmpeg-static`)
-- **Redis** (optional, required for the web dashboard)
+- **[NodeLink](https://github.com/PerformanC/NodeLink)** instance (Lavalink-compatible audio node)
+- **Redis** (optional — required only for the dashboard backend)
### Installation
@@ -262,8 +288,7 @@ The entrypoint will write it to `/app/config.json` on first boot if no config fi
- `mysql` — your MySQL connection details (host, port, user, password, database)
- `prefix` — the command prefix (default: `%`)
- `nodelink` — your NodeLink instance connection details
- - `spotify` — (optional) Spotify API credentials for Spotify track support
- - `geniusToken` — *(deprecated, unused)* was previously for lyrics; lyrics are now fetched via NodeLink
+ - `lastfm` — (optional) Last.fm API credentials for scrobbling/autoplay features
- `owners` — array of Fluxer user IDs with owner-only command access
4. **Set up the database:** *(See [Database Setup](#-database-setup) below)*
@@ -280,7 +305,7 @@ The entrypoint will write it to `/app/config.json` on first boot if no config fi
### Database Setup
-Remix requires a MySQL database to store per-guild settings.
+Remix requires a MySQL database to store per-guild settings and user data.
1. Create a dedicated database for Remix:
```sql
@@ -298,7 +323,7 @@ Remix requires a MySQL database to store per-guild settings.
}
```
-3. Create the required table:
+3. Create the required `settings` table:
```sql
CREATE TABLE `settings` (
`id` varchar(70) NOT NULL,
@@ -306,58 +331,39 @@ Remix requires a MySQL database to store per-guild settings.
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
```
-4. Create the track options table (for the `%trackopt` command):
- ```sql
- CREATE TABLE IF NOT EXISTS `track_options` (
- `id` INT AUTO_INCREMENT PRIMARY KEY,
- `user_id` VARCHAR(32) NOT NULL,
- `track_identifier` VARCHAR(512) NOT NULL,
- `track_title` VARCHAR(512) NOT NULL DEFAULT '',
- `start_ms` INT UNSIGNED NOT NULL DEFAULT 0,
- `end_ms` INT UNSIGNED NOT NULL DEFAULT 0,
- `bot_id` VARCHAR(32) NOT NULL DEFAULT '',
- `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- UNIQUE KEY `uq_user_track_bot` (`user_id`, `track_identifier`, `bot_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
- ```
- This table is auto-created on startup if it doesn't exist, so manual creation is optional.
+4. Everything else is **auto-created on startup** if missing:
+ - `track_options` — per-user per-track start/end times (`%trackopt`)
+ - `lastfm_users` — Last.fm session keys and scrobble opt-ins
+ - `lastfm_stats` — stored scrobble/link counts
-5. *(Optional)* If migrating from the legacy settings system, run:
+5. *(Optional)* If you need to clone or repair the settings table across bot IDs, run:
```bash
npm run migrate
```
### Dashboard Setup (Optional)
-Remix includes a web dashboard for controlling the bot through a browser interface.
+Remix ships the **backend half** of a web dashboard: a Redis-RPC service that an external frontend project talks to. There is no HTTP server or web UI in this repository.
-1. Enable the dashboard in `config.json`:
+1. Enable it in `config.json`:
```json
"dashboard": {
"enabled": true,
- "redis": { "url": "redis://localhost:6379" },
- "fluxer": {
- "id": "your-fluxer-oauth2-app-id",
- "secret": "your-fluxer-oauth2-client-secret",
- "redirectUri": "https://your-backend.com/auth/fluxer"
- }
+ "redis": { "url": "redis://localhost:6379" }
}
```
-2. Create a Fluxer OAuth2 application at Settings > application.
+2. How it works:
+ - The bot listens on Redis pub/sub channels (`request` / `response` / `info`) and answers JSON-RPC style requests with an `id` for correlation.
+ - Supported requests: `fetchPlayers`, `user`, `sharedServers`, `server`, `allServers`, `commands`, and `function` (remote actions: `join`, `pausePlayback`, `resumePlayback`, `skip`, `volume`, `addToQueue`, `voiceState`, `leave`, `testConnection`).
+ - Player updates are broadcast (debounced) on per-bot/per-player Redis channels so the frontend can render live state.
+ - **Login flow:** the external frontend writes login codes into the MySQL `login_codes` table; the bot verifies them with bcrypt hashes and marks them verified. Player control additionally requires the user to be in the same voice channel (owners are exempt).
-3. For HTTPS support, configure SSL in `config.json`:
- ```json
- "ssl": {
- "private": "/etc/letsencrypt/live/your.domain/privkey.pem",
- "cert": "/etc/letsencrypt/live/your.domain/fullchain.pem",
- "useSSL": true,
- "httpPort": 80
- }
- ```
+3. **Security note:** the RPC channel has **no shared secret** — anything that can publish to your Redis can invoke the remote actions. Keep Redis network-isolated (as the Docker setup does) and don't expose it publicly.
-### Configuration Reference
+---
+
+## Configuration Reference
Key configuration options in `config.json`:
@@ -367,28 +373,19 @@ Key configuration options in `config.json`:
| `prefix` | string | `%` | Default command prefix |
| `embedColor` | string | `0xe9196c` | Hex color for embed messages |
| `owners` | string[] | `[]` | User IDs with owner privileges |
-| `playerAFKTimeout` | number | `60000` | Inactivity timeout in ms before bot leaves |
+| `playerAFKTimeout` | number | `60000` | Inactivity timeout in ms before the player panel session ends |
| `customStatsFooter` | string | — | Custom text shown in the `%stats` embed footer |
-| `webPort` | number | `80` | Port for the web dashboard |
-| `helpCatalog` | bool | `true` | Enable categorized help command |
-| `helpPagination` | bool | `true` | Enable paginated help output |
+| `presenceInterval` | number | `30000` | Interval in ms for rotating bot presence status |
+| `presenceContents` | array | `[]` | Presence status messages to cycle through (strings or objects with `text`/`emoji_name`/`emoji_id`/`activity`) |
| `mysql` | object | — | **Required.** MySQL connection settings |
| `nodelink` | object | — | NodeLink connection (`host`, `port`, `password`, `requestTimeout`) |
-| `spotify` | object | — | Spotify API credentials (`clientId`, `clientSecret`) |
-| `geniusToken` | string | — | *(Deprecated, unused)* Previously for lyrics; lyrics are now fetched via NodeLink |
| `lastfm` | object | — | Last.fm integration (`apiKey`, `apiSecret`, `scrobbleThreshold`, `scrobbleMinMs`) |
-| `dashboard` | object | — | Dashboard config: `enabled`, `redis`, `fluxer` (OAuth2) |
-| `dashboardUrl` | string | — | URL the dashboard is accessible from |
-| `sessionSecret` | string | — | Secret for Express.js session middleware |
-| `logging` | object | — | Per-category log toggle (`enabled` + 12 sub-categories, see config example) |
-| `timers` | object | — | Timing values for inactivity, recovery, rejoin, etc. (14 sub-keys) |
-| `cache` | object | — | Guild and member cache (`guilds.enabled`, `guilds.max`, `members.enabled`, `members.max`) |
+| `fluxerlist` | object | — | FluxerList integration (`apiKey`, `serverId`, `botId`, `serverSlug`, `botSlug`) |
+| `dashboard` | object | — | Dashboard backend: `enabled`, `redis.url` |
| `radio` | array | `[]` | Custom radio station definitions |
-| `ssl` | object | — | SSL certificate paths (`private`, `cert`), `useSSL`, `httpPort` |
-| `presenceInterval` | number | — | Interval in ms for rotating bot presence status |
-| `presenceContents` | string[] | `[]` | Presence status messages to cycle through |
+| `logging` | object | — | Per-category log toggles: `enabled`, `warn`, and 14 categories (`player`, `inactivity`, `aloneCheck`, `voiceState`, `voice247`, `voice`, `mediaplayer`, `commands`, `guild`, `recovery`, `settings`, `lavalink`, `dashboard`, `redis`) |
+| `timers` | object | — | Timing values in ms: `inactivityTimeout`, `aloneCheckInterval`, `aloneCheckDebounce`, `rejoin247Delay`, `leave247RejoinDelay`, `playerUpdateInterval`, `searchSessionTimeout`, `playerSessionTimeout`, `intentionalLeaveTTL` |
| `fluxer.js` | object | — | Fluxer.js REST options (`timeout`, `retries`) |
-| `fluxer-api` | object | — | Fluxer API endpoint configuration |
---
@@ -396,63 +393,69 @@ Key configuration options in `config.json`:
```
fluxer/
-├── index.mjs # Entry point — Remix class, boot sequence, error handling
+├── index.mjs # Entry point — Remix class, boot sequence, alone-check,
+│ # presence rotation, error handling, graceful shutdown
├── config_example.json # Configuration template
├── package.json
-├── commands/ # Command modules (one file per command)
-│ ├── play.mjs # Play a track or playlist
+├── commands/ # 37 command modules (one file per command)
+│ ├── play.mjs # Play a track or playlist (Last.fm categories, providers)
│ ├── player.mjs # Interactive emoji control panel with live progress
-│ ├── settings.mjs # Per-guild settings management (prefix, 247, volume, etc.)
+│ ├── settings.mjs # Per-guild settings management (+ prefix/247 shortcuts)
│ ├── lyrics.mjs # Synced lyrics from NodeLink
│ ├── filter.mjs # Audio filter controls
│ ├── radio.mjs # Radio station management
-│ ├── debug.mjs # Voice connection debugger (owner only, paginated)
-│ ├── stats.mjs # Bot stats with live player count
-│ ├── lastfm.mjs # Last.fm account linking, scrobbling, and profile
+│ ├── debug.mjs # Voice connection debugger (owner only)
+│ ├── lastfm.mjs # Last.fm linking, scrobbling, profiles, leaderboards
│ ├── trackopt.mjs # Per-track start/end time options (set/get/remove/list)
│ └── ... # All other commands
├── src/
-│ ├── CommandHandler.mjs # Command loader, prefix manager, registry
-│ ├── MessageHandler.mjs # Message parsing, embed builder, pagination, help
-│ ├── PlayerManager.mjs # Spawns and manages per-channel Player instances
-│ ├── Player.mjs # Core player — queue, playback, filters, events
-│ ├── MoonlinkManager.mjs # Moonlink.js (Lavalink) node session manager
-│ ├── Settings.mjs # RemoteSettingsManager + ServerSettings export
-│ ├── GatewayHandler.mjs # Raw WS events, voice-state tracking, presence rotation
-│ ├── RecoveryManager.mjs # Session persistence, crash recovery, 24/7 auto-join
-│ ├── LastFmManager.mjs # Last.fm API client — auth, scrobbling, user data, stored scrobble stats
-│ ├── TrackOptionsManager.mjs # Per-user track start/end time preferences (auto-seek, auto-skip)
-│ ├── Utils.mjs # Shared utilities
-│ ├── worker.mjs # Background task worker
-│ ├── probe.mjs # FFprobe wrapper for audio stream info
+│ ├── CommandHandler.mjs # Command framework — builder, options, requirements,
+│ │ # cooldowns, prefix manager, loader
+│ ├── MessageHandler.mjs # Replies/embeds, reaction observers, pagination, help
+│ ├── PlayerManager.mjs # Player lifecycle, VC resolution & permission checks,
+│ │ # dashboard broadcasts, Last.fm scrobble wiring
+│ ├── Player.mjs # Core per-channel player — queue, playback, filters,
+│ │ # search sessions, autoplay, error circuit breaker
+│ ├── FluxerAudioBridge.mjs # Audio engine — NodeLink REST streams → sniff/remux/
+│ │ # encode → LiveKit publishing
+│ ├── LavalinkManager.mjs # lavalink-client wrapper (NodeLink mode) — search,
+│ │ # voice payload caching, node readiness
+│ ├── GatewayHandler.mjs # Raw WS events, voice-state routing, guild lifecycle,
+│ │ # 24/7 rejoin & rejoin retries
+│ ├── LastFmManager.mjs # Last.fm API client — auth, scrobbling, user data,
+│ │ # MySQL persistence (lastfm_users / lastfm_stats)
+│ ├── FluxerListManager.mjs # FluxerList voters API client (5-min TTL cache)
+│ ├── TrackOptionsManager.mjs # Per-user per-track start/end times (MySQL + LRU cache)
+│ ├── Settings.mjs # RemoteSettingsManager — MySQL-backed per-guild settings
+│ │ # with debounced JSON_SET writes
+│ ├── Utils.mjs # Shared utilities (IDs, durations, markdown, progress bar)
+│ ├── probe.mjs # ffprobe wrapper for audio stream info (radio metadata)
│ ├── constants/
│ │ ├── Logger.mjs # Structured logger with per-category control
│ │ ├── Locale.mjs # i18n translation engine
-│ │ ├── Helpers247.mjs # 24/7 mode helper utilities
-│ │ ├── providers.mjs # Audio source provider definitions
+│ │ ├── Helpers247.mjs # 24/7 mode helpers
+│ │ ├── UI.mjs # Emoji + UI constants
+│ │ ├── providers.mjs # 45+ audio source provider definitions
+│ │ ├── VoiceStateCache.mjs # Dual LRU voice-state caches (humans / bots)
+│ │ ├── VoiceStateResolver.mjs # Voice-state normalization + humans-in-channel check
│ │ └── audio/
-│ │ ├── StreamMerger.mjs # Audio stream merging utilities
-│ │ └── Tuna.mjs # Audio filter/effect processing
+│ │ └── WebMOpusMuxer.mjs # Streaming EBML/Matroska muxer (Opus → WebM for LiveKit)
│ └── dashboard/
-│ ├── Dashboard.mjs # Web dashboard server (Express + WebSocket)
-│ ├── DatabaseManager.mjs # Dashboard database query manager
-│ └── RedisHandler.mjs # Redis session and pub/sub handler
+│ ├── Dashboard.mjs # Dashboard backend — Redis RPC, player/user serializers,
+│ │ # remote-control actions with authorization checks
+│ ├── DatabaseManager.mjs # mysql2 pool + parameterized queries + bcrypt helpers
+│ └── RedisHandler.mjs # Redis pub/sub RPC transport with reconnect handling
├── settings/
-│ ├── Settings.mjs # Abstract SettingsManager base class
-│ ├── migrate.mjs # Legacy-to-remote settings migration script
-│ ├── runnables.mjs # Runnable task definitions
+│ ├── Settings.mjs # Re-export of src/Settings.mjs classes
+│ ├── migrate.mjs # One-shot settings table clone/repair tool
+│ ├── runnables.mjs # Setting validators (prefix, pfp, stay_247)
│ └── README.md # Settings system documentation
-├── docker/ # Docker self-hosting (Dockerfile, compose, configs)
-│ ├── Dockerfile # Multi-stage build (Node 22 + FFmpeg + tini)
-│ ├── docker-entrypoint.sh # Config validation on first boot
-│ ├── docker-compose.yml # bot + MySQL + Redis + NodeLink
-│ ├── config_example.json # Docker-friendly config template
-│ ├── .env.example # Secrets template
-│ └── nodelink.config.json # NodeLink audio node config
+├── docker/ # Docker self-hosting (Dockerfile, compose, entrypoint,
+│ # config templates, .env.example)
└── storage/
├── defaults.json # Default per-guild settings template
- ├── modules.json # Plugin module registry
- ├── stats.json # Runtime statistics
+ ├── modules.json # Plugin module registry (empty by default)
+ ├── stats.json # Static counters
└── locales/bot/ # Translation files
├── en.json
├── ar-SA.json
@@ -487,9 +490,7 @@ To add a new language, place a JSON file in `storage/locales/bot/` following the
| :--- | :--- | :--- |
| `npm start` | `node index.mjs` | Start the bot |
| `npm run dev` | `node --inspect index.mjs --trace-warnings` | Start with Node.js inspector |
-| `npm run commands` | `node index.mjs usage` | Generate command usage documentation |
-| `npm run defaultsSync` | `node index.mjs sreload` | Sync default settings to all guilds |
-| `npm run migrate` | `node settings/migrate.mjs` | Run the legacy settings migration |
+| `npm run migrate` | `node settings/migrate.mjs` | Clone/repair the remote settings table |
---
@@ -502,12 +503,13 @@ To add a new language, place a JSON file in `storage/locales/bot/` following the
**Powered by:**
- [`@fluxerjs/core`](https://github.com/fluxerjs/core) — Fluxer API client
-- [`revoice.js`](https://www.npmjs.com/package/revoice.js) — LiveKit voice connection and MediaPlayer
-- [`@fluxerjs/voice`](https://github.com/fluxerjs/voice) — Native voice channel integration
-- [`moonlink.js`](https://github.com/Ecliptia/moonlink.js) — Lavalink proxy
-- [`NodeLink`](https://github.com/PerformanC/NodeLink) — Audio node manager
+- [`@fluxerjs/voice`](https://github.com/fluxerjs/voice) — LiveKit voice connections and playback
+- [`lavalink-client`](https://www.npmjs.com/package/lavalink-client) — Lavalink/NodeLink client (search + streaming)
+- [`NodeLink`](https://github.com/PerformanC/NodeLink) — Lavalink-compatible audio node
+- [`prism-media`](https://github.com/discordjs/prism-media) — Opus encoding and stream demuxing
© 2026 Remix. Code licensed under the MIT License.
The Remix name, logo, and branding are proprietary and may not be reused.
+
diff --git a/commands/autoplay.mjs b/commands/autoplay.mjs
index 2a98cbd..11abe2f 100644
--- a/commands/autoplay.mjs
+++ b/commands/autoplay.mjs
@@ -1,6 +1,6 @@
/**
- * @file autoplay command — Toggle autoplay to automatically play similar tracks when the queue ends
* @module commands/autoplay
+ * @description Toggle autoplay mode — automatically play similar tracks when the queue ends.
*/
import { CommandBuilder } from "../src/CommandHandler.mjs";
@@ -8,6 +8,7 @@ import { EmbedBuilder } from "@fluxerjs/core";
import { getGlobalColor } from "../src/MessageHandler.mjs";
import { logger } from "../src/constants/Logger.mjs";
+/** @type {CommandBuilder} @description Command definition for the autoplay command. */
export const command = new CommandBuilder()
.setName("autoplay")
.setDescription("Toggle autoplay — automatically play similar tracks when the queue ends.", "commands.autoplay")
@@ -15,9 +16,12 @@ export const command = new CommandBuilder()
.addAliases("ap");
/**
- * Execute the autoplay command.
- * @param {import("../src/MessageHandler.mjs").Message} msg - The incoming message
- * @param {Map} data - Slash-command options map
+ * @async
+ * Run handler for the autoplay command.
+ * Toggles autoplay on the player. When enabled, registers a queueEnd listener
+ * that fetches similar tracks (via Last.fm or YouTube) and adds them to the queue.
+ * @param {object} msg - The command message wrapper.
+ * @param {object} data - Parsed command data (unused, no options required).
* @returns {Promise}
*/
export async function run(msg, data) {
diff --git a/commands/clear.mjs b/commands/clear.mjs
index 9832a05..a41870d 100644
--- a/commands/clear.mjs
+++ b/commands/clear.mjs
@@ -1,12 +1,16 @@
/**
- * @file clear command — Remove all songs from the queue
* @module commands/clear
+ * @description Remove all songs from the playback queue.
*/
import { CommandBuilder } from "../src/CommandHandler.mjs";
import { EmbedBuilder } from "@fluxerjs/core";
import { getGlobalColor } from "../src/MessageHandler.mjs";
+/**
+ * @type {CommandBuilder}
+ * @description Command definition for the clear command.
+ */
export const command = new CommandBuilder()
.setName("clear")
.setDescription("Remove all songs from the queue.", "commands.clear")
@@ -14,9 +18,10 @@ export const command = new CommandBuilder()
.setCategory("music");
/**
- * Execute the clear command.
- * @param {import("../src/MessageHandler.mjs").Message} msg - The incoming message
- * @param {Map} data - Slash-command options map
+ * Run handler for the clear command.
+ * Clears the entire queue and sends a confirmation embed.
+ *
+ * @param {object} msg - The command message wrapper.
* @returns {Promise}
*/
export async function run(msg) {
diff --git a/commands/debug.mjs b/commands/debug.mjs
index f0eb94d..123d235 100644
--- a/commands/debug.mjs
+++ b/commands/debug.mjs
@@ -1,6 +1,6 @@
/**
- * @file debug command — Owner-only debug utilities for voice connections, ghost detection, and forced rejoins
* @module commands/debug
+ * @description Owner-only debug command for voice diagnostics, ghost connection detection, and forced rejoin.
*/
import { CommandBuilder } from "../src/CommandHandler.mjs";
@@ -15,9 +15,10 @@ const INTENTIONAL_LEAVE_TTL = 30_000;
const MAX_DESC = 4096;
/**
- * Return a human-readable label for a voice room's connection state.
- * @param {object} room - The voice room instance
- * @returns {string}
+ * Get a human-readable label for a voice room's connection state.
+ * @private
+ * @param {object|null} room - The voice room object.
+ * @returns {string} Connection state label.
*/
function roomStateLabel(room) {
if (!room) return "none";
@@ -33,10 +34,10 @@ function roomStateLabel(room) {
}
/**
- * Detect whether a player has a "ghost" connection — the player object exists
- * but the underlying voice room is disconnected, reconnecting, or absent.
- * @param {import("../src/Player.mjs").default} player
- * @returns {boolean}
+ * Check if a player has a ghost connection (appears in voice but WebSocket is dead).
+ * @private
+ * @param {object} player - The player instance.
+ * @returns {boolean} True if the player has a ghost connection.
*/
function isGhostConnection(player) {
const conn = player.connection;
@@ -58,10 +59,11 @@ function isGhostConnection(player) {
}
/**
- * Retrieve the bot's voice state from the gateway cache for a given guild.
- * @param {object} client - The Fluxer client instance
- * @param {string} guildId - The guild ID to look up
- * @returns {{ userId: string, channelId: string } | null}
+ * Get the bot's voice channel state from the Discord gateway cache.
+ * @private
+ * @param {object} client - The Discord client instance.
+ * @param {string} guildId - The guild ID to check.
+ * @returns {{ userId: string, channelId: string }|null} Bot's voice state or null.
*/
function getBotGatewayVoiceState(client, guildId) {
const botId = client.user?.id;
@@ -108,10 +110,11 @@ function getBotGatewayVoiceState(client, guildId) {
}
/**
- * Check whether the gateway voice state is stale compared to the player's expected channel.
- * @param {object} client - The Fluxer client instance
- * @param {import("../src/Player.mjs").default} player
- * @returns {boolean}
+ * Check if the gateway voice state is stale (mismatches the player's channel).
+ * @private
+ * @param {object} client - The Discord client instance.
+ * @param {object} player - The player instance.
+ * @returns {boolean} True if the gateway presence is stale.
*/
function isStaleGatewayPresence(client, player) {
const guildId = player._guildId ?? player._resolveGuildId?.();
@@ -127,11 +130,12 @@ function isStaleGatewayPresence(client, player) {
}
/**
- * Build a human-readable label for a player's guild/channel.
- * @param {object} client - The Fluxer client
- * @param {string} channelId - The channel ID
- * @param {import("../src/Player.mjs").default} player
- * @returns {string}
+ * Build a human-readable label for a player (guild name / #channel name).
+ * @private
+ * @param {object} client - The Discord client instance.
+ * @param {string} channelId - The voice channel ID.
+ * @param {object} player - The player instance.
+ * @returns {string} Formatted label string.
*/
function buildPlayerLabel(client, channelId, player) {
const channel = client.channels.get(channelId);
@@ -141,10 +145,12 @@ function buildPlayerLabel(client, channelId, player) {
}
/**
- * Destroy a player's stale connection and respawn a fresh player, restoring queue, loop, filters, and playback.
- * @param {object} ctx - The bot context (this)
- * @param {import("../src/Player.mjs").default} player
- * @returns {Promise<{ success: boolean, reason?: string, channelId?: string, roomConnected?: boolean, roomState?: string, resumedPlayback?: boolean }>}
+ * Force a player to leave and rejoin, restoring queue and playback state.
+ * @private
+ * @async
+ * @param {object} ctx - The bot (Remix) instance context.
+ * @param {object} player - The player to rejoin.
+ * @returns {Promise