The self-hosted music bot for Discord server

Play music from YouTube, Spotify, and Deezer directly in your Discord voice channels. Fast autocomplete search, clean single-message button controls, and zero channel spam.

discord / #music-room
Alfred Discord Player View

Built for servers that care about audio fidelity and clean channels.

Audio never touches the main Python bot process. A dedicated Lavalink node handles decoding and playback streaming while Alfred manages your server requests.

🎡

Multi-Source Streaming

Stream directly from YouTube, Spotify, and Deezer. Supports tracks, full albums, playlists, and raw audio URLs.

YouTube Spotify Deezer Direct URLs
⚑

LavaSearch Autocomplete

Instant search suggestions right inside Discord's slash command input. Filter by track name, artist, album, or playlist.

/search Live Query LavaSearch
πŸŽ›οΈ

Unified Queue Panel

Single-message interactive UI. Pause, Skip, cycle Loop modes, and Stop using Discord buttons with instant state updates.

No Spam In-Place Redraw Button Actions
πŸ”‡

Zero Unprompted Spam

Alfred never speaks unless spoken to. Every embed is a direct slash reply. Buttons expire cleanly after 3 minutes of inactivity.

Quiet Bot Clean Channels
πŸ‘‚

Smart Deafen & Auto-Leave

Deafening yourself automatically pauses playback when you are the sole listener. Alfred disconnects when voice channels empty.

Auto-Pause Auto-Leave
πŸ›‘οΈ

yt-cipher Bypass

Includes a companion cipher server that executes obfuscated YouTube player scripts to resolve streaming signatures reliably.

yt-cipher Docker Ready

Eight concise commands. One reactive interface.

`/play` connects to your voice channel automatically - no `/join` needed. Try clicking the buttons below to test the reactive panel state machine.

# music-room
INTERACTIVE DEMO
Alfred
Alfred BOT Today at 7:42 PM
🎢 Currently Playing
1. Red Hot Chili Peppers - Can't Stop
01:58 04:29
UP NEXT (3 TRACKS):
2. Daft Punk - Instant Crush 05:37
3. Gorillaz - Feel Good Inc. 03:41
πŸ’‘ Press buttons to test reactive updates. Queue redraws in place on every click.
Group Command Description
MUSIC /play Add track, playlist or URL to queue with auto voice join
MUSIC /search Live autocomplete across tracks, artists, and playlists
QUEUE /queue Open the interactive button panel and track list
QUEUE /skip Move forward to the next queued track
QUEUE /remove Drop a specific track from the queue index
VOICE /leave Disconnect bot from voice and clear player state
OWNER /stats Display Lavalink node health and memory metrics
OWNER /info Show running bot versions, plugins, and Lavalink info
Source Configuration Caveats:
β€’ YouTube: Zero credentials required; handled via local yt-cipher server.
β€’ Spotify: Requires clientId and clientSecret in configuration.
β€’ Deezer: Disabled until masterDecryptionKey is provided.

Engineered for zero-lag streaming.

Alfred isolates control logic from audio transport, guaranteeing high responsiveness even under heavy server load.

Component Topology & Audio Pipeline
flowchart TD
    subgraph Discord["Discord Platform"]
        User["User / Discord Client"]
        VC["Voice Channel"]
    end

    subgraph Bot["Alfred Bot"]
        Hikari["hikari Gateway & lightbulb"]
        Service["Alfred Service & Player State"]
    end

    subgraph Node["Lavalink Audio Node (JVM)"]
        Lavalink["Lavalink Server Engine"]
        Plugins["LavaSrc Β· LavaSearch Β· YouTube Plugin"]
    end

    subgraph Daemon["Signature Daemon"]
        Cipher["yt-cipher Container"]
    end

    subgraph Sources["Audio Sources"]
        YT["YouTube"]
        SP["Spotify"]
        SC["SoundCloud / Deezer / Bandcamp"]
    end

    User -->|"Slash commands & panel buttons"| Hikari
    Hikari --> Service
    Service -->|"REST / WebSocket (lavalink.py)"| Lavalink
    Lavalink --- Plugins
    Plugins -->|"JavaScript decipher requests"| Cipher
    Plugins -->|"Audio stream extraction"| Sources
    Lavalink ==>|"Direct voice UDP stream"| VC
          

Up and running in three steps.

Choose Docker Compose for production deployments or uv for local development.

BASH / CLI
# 1. Clone & prepare environment files
cp .env.example .env
cp lavalink/application.yml.example lavalink/application.yml

# 2. Set DISCORD_TOKEN & CIPHER_PASSWORD in .env
# Linux permissions (first run only):
chown -R 322:322 lavalink/logs lavalink/plugins

# 3. Start all three services (yt-cipher, Lavalink, Alfred)
docker compose up -d
Docker Compose automatically starts yt-cipher, Lavalink, and the bot in ordered sequence. To rebuild after local edits, run docker compose up -d --build bot.
# Requires Java 21+ for Lavalink
winget install --id Microsoft.OpenJDK.21 -e

# Terminal 1: Run Lavalink node
.\scripts\lavalink.ps1

# Terminal 2: Run Alfred bot with uv
uv sync --frozen
uv run alfred
Running locally connects directly to LAVALINK_HOST=127.0.0.1. Run checks with uv run pytest and uv run ruff check ..
# Check VPS deployment guide for machine hardening & OAuth
git clone https://github.com/nauqh/alfred.git /opt/alfred
cd /opt/alfred

# Follow docs/deploy.md for YouTube OAuth token generator
# and systemd/docker restart configurations
When running on VPS host IPs flagged by YouTube, configure YouTube OAuth as documented in docs/deploy.md.

Deep dive into deployment and architecture.

Comprehensive guides covering production operations, internal design specs, and multi-node clusters.