Skip to content

A feature-rich, customizable Discord music bot built with Node.js and discord.js. Supports YouTube, Spotify, and more, with advanced queue and playback controls, admin features, and easy configuration. Uses Lavalink with advanced plugins for high-quality audio streaming.

Notifications You must be signed in to change notification settings

atifahmed9461/Lavasic

Repository files navigation

Lavasic

Lavasic Banner

A feature-rich, customizable Discord music bot built with Node.js and discord.js. Supports YouTube, Spotify, and more, with advanced queue and playback controls, admin features, and easy configuration. Uses Lavalink with advanced plugins for high-quality audio streaming.

Features

  • 🎵 Music Playback: Play, pause, resume, skip, stop, seek, replay, previous, clear queue, and volume control
  • 🔁 Loop & Filters: Loop tracks/queue, apply audio filters
  • 📃 Queue Management: View, manage, and clear the music queue
  • ℹ️ Information: Now playing, help, ping, uptime
  • ⚙️ Settings: Change bot prefix, reset prefix
  • 👑 Admin: Manage custom playlists (add, list, remove)
  • 🎧 Spotify Integration: Play tracks from Spotify (requires credentials)
  • 🗄️ SQLite Database: Persistent storage for settings and sessions
  • 🛠️ Custom Emoji: Rich emoji feedback for all actions
  • 🔊 Advanced Lavalink Support: High-quality audio streaming with LavaSrc and YouTube plugins
  • 🎼 Lyrics Support: Automatic lyrics fetching from Spotify and YouTube
  • 🔍 Multi-Source Search: Fallback search across multiple platforms

Required Lavalink Plugins

This bot requires two essential Lavalink plugins for full functionality:

1. LavaSrc Plugin

  • Dependency: com.github.topi314.lavasrc:lavasrc-plugin:4.7.2
  • Purpose: Enhanced Spotify integration with lyrics support
  • Features: Better track resolution, lyrics fetching, multi-source search

2. YouTube Plugin

  • Dependency: dev.lavalink.youtube:youtube-plugin:1.13.3
  • Purpose: Better YouTube support with multiple client types
  • Features: Enhanced search, direct video/playlist support, better compatibility

Both plugins are automatically downloaded when you run Lavalink with the provided configuration.

Getting Started

Prerequisites

  • Node.js v16+
  • A Discord bot token (guide)
  • Lavalink Server (see setup below)

Lavalink Setup

Option 1: Use a Local Lavalink Server

You can use a local Lavalink server. Add these to your .env file:

LAVALINK_HOST=localhost
LAVALINK_PORT=2333
LAVALINK_PASSWORD=your_password_here
LAVALINK_SECURE=false

Option 2: Self-Host Lavalink (Recommended)

  1. Download Lavalink:

    wget https://github.com/lavalink-devs/Lavalink/releases/download/4.0.0/Lavalink.jar
  2. Create application.yml: See LAVALINK_SETUP.md for the complete advanced configuration with plugins.

  3. Run Lavalink:

    java -jar Lavalink.jar

Installation

  1. Clone the repository:

    git clone https://github.com/atifahmed9461/Lavasic.git
    cd Lavasic
  2. Install dependencies:

    npm install
  3. Set up environment variables: Create a .env file in the root directory with the following:

    TOKEN=your_discord_bot_token
    PREFIX=!
    SPOTIFY_CLIENT_ID=your_spotify_client_id
    SPOTIFY_CLIENT_SECRET=your_spotify_client_secret
    
    # Lavalink Configuration
    LAVALINK_HOST=localhost
    LAVALINK_PORT=2333
    LAVALINK_PASSWORD=your_password_here
    LAVALINK_SECURE=false

    (Spotify credentials are optional but recommended for full functionality)

  4. Configure the bot: Edit settings/config.js to customize bot settings, status, owner ID, and more.

Running the Bot

  • Production:
    npm start
  • Development (with auto-reload):
    npm run dev

Command Categories

  • Music: play, stop, pause, resume, skip, queue, loop, filters, nowplaying, seek, replay, previous, clearqueue, volume
  • Information: help, ping, uptime
  • Admin: npadd, nplist, npremove
  • Settings: setprefix, resetprefix

File Structure

Lavasic/
  commands/
    message/
      Admin/         # Playlist management
      Information/   # Bot info commands
      Music/         # Music playback & queue
      Settings/      # Prefix and config
  database/          # SQLite DB files
  events/            # Event handlers
  fonts/             # Font files
  settings/          # Config, emoji, node
  utils/             # Utility modules
  index.js           # Main entry point

Lavalink Benefits

  • Better Audio Quality: Higher bitrate and better codec support
  • Reduced CPU Usage: Audio processing handled by Lavalink server
  • More Sources: Support for YouTube, Spotify, SoundCloud, Bandcamp, Twitch, Vimeo, Nico
  • Advanced Features: Audio filters, equalizer, lyrics support, and more
  • Plugin Support: LavaSrc for enhanced Spotify integration, YouTube plugin for better search
  • Scalability: Can handle multiple bots and servers
  • Multi-Source Search: Intelligent fallback across different platforms

Advanced Features

  • LavaSrc Plugin: Enhanced Spotify integration with lyrics and better search
  • YouTube Plugin: Improved YouTube support with multiple client types
  • Lyrics Support: Automatic lyrics fetching from Spotify and YouTube
  • High-Quality Audio: Optimized Opus encoding and buffer settings
  • Comprehensive Logging: File-based logging with rotation

Troubleshooting

  • Lavalink Connection Issues: Check if your Lavalink server is running and credentials are correct
  • Plugin Loading Issues: Ensure Java 17+ and internet connection for plugin downloads
  • Audio Quality: Ensure you're using a good Lavalink server with proper bandwidth
  • Spotify Issues: Verify your Spotify API credentials in the .env file
  • Memory Issues: Allocate at least 2GB RAM for Lavalink with plugins

Support Server

Join our Discord for help and community support: https://discord.gg/tsbBKz2k53

Creator

Created by Atif Ahmed 🖤

Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

License

ISC


Made with ❤️ for Discord communities.

About

A feature-rich, customizable Discord music bot built with Node.js and discord.js. Supports YouTube, Spotify, and more, with advanced queue and playback controls, admin features, and easy configuration. Uses Lavalink with advanced plugins for high-quality audio streaming.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published