melodix

Melodix banner

Go Reference Release License

Melodix

A self-hosted Discord music bot written in Go, with a terminal player thrown in. It streams YouTube, SoundCloud and internet radio, and it’s built around one stubborn idea: playback should survive — flaky streams, dead voice connections, gateway reconnects, all of it.

Public music bots come and go, usually with a cease-and-desist attached. Melodix is the opposite deal: a small binary you run yourself, with your own token, on your own machine. Nobody can turn it off for you.

What it does well

Try it

The bot lives in the Ctrl+Z Discord server — hop into a voice channel and use slash commands in #music-spam.

Prebuilt binaries are on the releases page.

Quick start

# Discord bot — token from the Discord Developer Portal
go build -o melodix-discord ./cmd/discord
DISCORD_TOKEN=your-token ./melodix-discord

# ...or the terminal player, no Discord account required
go build -o melodix-cli ./cmd/cli
./melodix-cli

You need FFmpeg in PATH; yt-dlp is optional but recommended. The full setup guide — creating the bot, invite link, every config knob, Docker — is in docs/running.md.

Commands

🕯️ Information

🎵 Music

⚙️ Settings

/play takes more than links:

/play never gonna give you up                       search query (YouTube)
/play https://www.youtube.com/watch?v=dQw4w9WgXcQ   direct link (YouTube / SoundCloud)
/play http://stream-uk1.radioparadise.com/aac-320   internet radio stream
/play 42                                            replay entry 42 from /history

Under the hood

The playback engine (pkg/music) is a standalone Go library with no Discord in it: resolver → queue → recovery stream → sink. The Discord bot is one consumer of it, the CLI is another. If you’re curious how the parser fallback and voice recovery actually work, docs/architecture.md walks through the whole thing.

License

MIT