
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.
/history shows what was played; /play 42 replays
entry 42. No link hunting.melodix-cli,
which plays straight to your speakers. Good for testing, also just for listening.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.
# 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.
/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
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.