git clone https://github.com/nauqh/alfred

The self‑hosted music bot for Discord

Music in the voice channel you are already in. Play from YouTube, Spotify, SoundCloud and Deezer while you game and talk, from a bot you host yourself.

For friends who play with music on

You are in voice, mid-match, talking over the music. Queue a song with one command and it keeps playing while you play.

Every source you use

YouTube, Spotify, SoundCloud and Deezer. Tracks, albums, playlists and direct URLs.

Search as you type

Suggestions appear in the slash command box, by track, artist, album or playlist.

One player card

Pause, skip and loop from its buttons. The card updates in place.

Quiet by default

Alfred answers when asked and never posts on its own.

Leaves when you do

Disconnects as soon as the last listener leaves the channel.

Song in the sidebar

The member list shows what is playing, right under Alfred's name.

It lives in your text channel

Everything Alfred posts is a card: what is playing, how far in, and what comes next.

Alfred's queue card in Discord, showing the current track with a progress bar and two tracks up next

The queue

The current track with its progress, and the tracks lined up after it.

A Discord conversation where Alfred shows the now playing card, queues a song and lists the queue

Now playing

Ask what is on and Alfred answers with the card, in the same channel.

Seven commands

/play joins your voice channel on its own, so there is nothing to set up first. Each command is shown the way you would type it.

Queue

See and change what is next

4

/now

Show the track that is playing now.

/now

/queue

Show the queue.

/queue

/skip

Skip the current track.

/skip

/remove

Remove a track from the queue by its number.

/remove track: 2

Music

Find something and play it

2

/play

Play a track or playlist URL, or search YouTube for it.

/play query: daft punk get lucky
  • Options
  • next
  • loop
  • shuffle

/search

Search one source for a track, artist, album or playlist, with suggestions as you type.

/search query: get lucky
  • Options
  • type
  • source
  • next
  • loop
  • shuffle

Voice

Your voice connection

1

/leave

Leave the voice channel and clear the queue.

/leave

You rarely need it: Alfred leaves on its own when the last listener does.

Music in your voice channel. Nothing extra in your text channels.

Control and audio never share a process

Alfred handles your commands. A separate Lavalink node does the audio, so a long track never slows the bot down.

Up and running in three steps

Docker Compose starts everything Alfred needs. Use uv if you want to work on the code.

# 1. Prepare the config files
cp .env.example .env
cp lavalink/application.yml.example lavalink/application.yml

# 2. Set DISCORD_TOKEN and CIPHER_PASSWORD in .env
#    On Linux, first run only (the node runs as uid 322):
mkdir -p lavalink/logs lavalink/plugins
sudo chown -R 322:322 lavalink/logs lavalink/plugins

# 3. Start yt-cipher, Lavalink and the bot
docker compose up -d

After editing the code, rebuild with docker compose up -d --build bot. Running on a VPS? Follow the deploy guide.

# Lavalink 4 needs Java 17+
winget install --id Microsoft.OpenJDK.21 -e

# Config: in .env set DISCORD_TOKEN and LAVALINK_HOST=127.0.0.1
cp .env.example .env
cp lavalink/application.yml.example lavalink/application.yml

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

# Terminal 2: the bot
uv sync --frozen
uv run alfred

Checks: uv run pytest and uv run ruff check .

Documentation

Deployment, how the code is put together, and the decisions behind it.