Skip to content

Latest commit

 

History

110 Commits

Folders and files

Repository files navigation

Nexa Music v3

Nexa Music v3 banner

Release v3.0.0 Bun 1.2+ Node.js 18+ TypeScript 5.x discord.js v14 Lavalink v4

Support server Components V2 SQLite and Drizzle MIT License

Modern Discord music bot with typed architecture, polished music panels, playlist persistence, and production-ready Lavalink flow.

Overview

Nexa Music v3 is a TypeScript Discord music bot built on discord.js v14, riffy, and Lavalink v4. It focuses on clean interaction design, stronger runtime safety, and a scalable codebase.

v3 introduces four new commands (/search, /bassboost, /speed, /grab), full environment variable configuration, bug fixes for prefix adapter user resolution and duplicate handlers, improved queue display, and zero TypeScript type errors.

What's New In v3

Area Changes
New Commands /search, /bassboost, /speed, /grab
Configuration All settings configurable via .env environment variables
Bug Fixes Fixed duplicate nodeError handler, prefix adapter getUser() returning null, removed as never casts
Queue Display Shows track durations, total queue duration, requester names, handles large queues
Reliability Uses stable client.riffy.nodes API instead of undocumented internals
Type Safety Zero tsc errors across the entire codebase
Cleanup Removed unused pretty-ms dependency, pinned discord.js@14.21.0

What's Inherited From v2

Area Highlights
UI Full Components V2 panel-based replies and richer playback messaging
Type Safety Full JS to TS migration with typed client, commands, events, and storage
Playback Track control buttons, improved autoplay logic, pause/resume sync, and queue flow cleanup
Persistence SQLite storage for playlists and guild 24/7 settings
Commands Recursive command loading and hybrid prefix/slash support
Diagnostics Improved node stats, health views, and collector timeout handling
Reliability Better reconnect handling and safer player state checks

Tech Stack

Tech stack icons

Layer Tools
Bot Framework discord.js v14
Audio Layer riffy + Lavalink v4
Language TypeScript
Storage better-sqlite3 + Drizzle ORM
UI System Discord Components V2
Config dotenv with full .env support
Integrations Top.gg SDK, Genius Lyrics API
Architecture Typed commands, events, handlers, storage, and utils

Supported Music Sources

YouTube YouTube Music SoundCloud Spotify Apple Music Deezer

Supported platforms depend on your Lavalink configuration and plugins.

Feature Set

Music

  • /play - Search and queue tracks or playlists
  • /search - Interactive search with button selectors (NEW in v3)
  • /skip, /stop, /pause, /resume
  • /queue - Improved display with durations and totals (Updated in v3)
  • /seek, /shuffle, /loop, /volume
  • /nowplaying - Now playing panels with interactive control buttons
  • /autoplay - Autoplay with stronger current-track checks
  • /247 - 24/7 mode with persisted guild settings
  • /join, /leave, /clear, /remove, /previous
  • /bassboost - Bass boost presets (NEW in v3)
  • /speed - Playback speed control (NEW in v3)
  • /grab - Save current track to DMs (NEW in v3)
  • /lyrics - Auto-scrolling lyric pages

Playlist

  • /playlist-create
  • /playlist-add
  • /playlist-load
  • /playlist-view
  • /playlist-remove
  • /playlist-delete

Info + Utility

  • /help
  • /node
  • /ping
  • /about
  • /avatar
  • /serverinfo
  • /uptime

Developer

  • /eval
  • /shards

Project Structure

src/
  commands/
    hybrid/
    interaction/
      developer/
      information/
      music/
      playlist/
      utility/
  events/
    bot/client/
    riffy/node/
    riffy/player/
  handlers/
  settings/
  storage/
  types/
  utils/

Quick Start

1. Clone the repository

git clone https://github.com/koddyvx/Nexa-Music.git
cd Nexa-Music

2. Install dependencies

Recommended:

bun install

Node fallback:

npm install

3. Create your environment file

cp .env.example .env

4. Configure the bot

Edit your .env file with the following values:

# Required
TOKEN=your_discord_bot_token
CLIENT_ID=your_bot_client_id

# Optional
TOPGG_TOKEN=your_topgg_token
GENIUS_TOKEN=your_genius_api_token
DEVELOPER_IDS=875402851986325504

# Bot Settings
PREFIX=-
EMBED_COLOR=ff0000
SEARCH_ENGINE=ytsearch

# Lavalink Node
NODE_NAME=nexa-1
NODE_HOST=lava-v4.ajieblogs.eu.org
NODE_PORT=443
NODE_PASSWORD=your_lavalink_password
NODE_SECURE=true

All values have sensible defaults if omitted. See .env.example for the full list.

5. Build and run

bun run typecheck
bun run build
bun run start

Direct bot process:

bun run start:bot

Node fallback:

npm run typecheck
npm run build
npm run start:node

Requirements

Requirement Version
Bun 1.2+ recommended
Node.js 18+
Java 17+ recommended for Lavalink
Lavalink v4
Discord Bot Valid token and application setup

Database Guide

Item Path
DB Init src/storage/db.ts
Schema src/storage/schema.ts
Playlists src/storage/playlists.ts
Guild Settings src/storage/guildSettings.ts
Config drizzle.config.ts
SQLite File storage/nexa.sqlite

Drizzle commands:

npm run db:generate
npm run db:push
npm run db:studio

Components V2 UI

  • Shared panel helpers live in src/utils/discord.ts
  • Help and node commands use collectors with timeout lock behavior
  • Playback responses are standardized around the same panel system

24/7 + Reconnect Notes

  • /247 mode:on enables persistent 24/7 mode per guild
  • Queue end will not disconnect when 24/7 is enabled
  • Voice disconnects trigger reconnect handling
  • Node disconnects retry automatically with logged status

Release Notes

v3.0.0

  • Four new commands: /search, /bassboost, /speed, /grab
  • Full environment variable configuration for all settings
  • Fixed duplicate nodeError handler causing double log entries
  • Fixed prefix adapter getUser() now resolves mentions and usernames
  • Removed as never type casts, replaced with proper type assertions
  • Improved queue display with durations and total time
  • Uses stable client.riffy.nodes API instead of undocumented internals
  • Removed unused pretty-ms dependency
  • Pinned discord.js@14.21.0 for stable type compatibility
  • Zero TypeScript type errors across the entire codebase

v2.0.0

  • Full TypeScript migration
  • Advanced Components V2 UI flow
  • SQLite + Drizzle playlist persistence
  • Hybrid prefix/slash command structure
  • Stronger node diagnostics and player state handling
  • Better permission and interaction guards

Support

Useful Links

License

This project is licensed under MIT. Please follow Discord and streaming platform terms when deploying publicly.

Built by KoDdy and Razi under Infinity.

Releases

Packages

Contributors

Languages