
Melodix is a music player you can run as a Discord bot (plays in voice channels) or as a CLI app (plays on your machine). Same playback engine for both: YouTube, SoundCloud, and internet radio. Written in Go.
Limitations: Cannot play YouTube live streams or region-locked videos. Not every radio stream format is supported. Playback may occasionally pause or vary slightly when retrying with a different stream method.
#bot-music-spam text channel.Music examples: Play by search query or by link. You must be in a voice channel to use /music play.
/music play Never Gonna Give You Up
/music play https://www.youtube.com/watch?v=dQw4w9WgXcQ
/music play http://stream-uk1.radioparadise.com/aac-320
You can run the Discord bot (voice channels) or the CLI player (local playback). Both use the same sources and queue logic.
For the Discord bot you also need a Discord bot token from the Discord Developer Portal.
DISCORD_TOKEN).Invite the bot to your server using this URL (replace YOUR_APPLICATION_ID with your Application ID from step 1):
https://discord.com/oauth2/authorize?client_id=YOUR_APPLICATION_ID&scope=bot&permissions=3238912
This link only requests the permissions the bot needs: View Channel, Send Messages, Embed Links, Read Message History, Manage Messages, Connect to Voice Channel, Speak.
Create a .env file in the folder where you run the bot (or set the same variables in your environment):
# Required for the Discord bot
DISCORD_TOKEN=your-discord-bot-token
Optional variables (you can add these to .env if needed):
| Variable | Description | Default |
|---|---|---|
STORAGE_PATH |
Path for bot data (e.g. command state). | ./data/datastore.json |
INIT_SLASH_COMMANDS |
Set to true to register slash commands on every startup. |
false |
DEVELOPER_ID |
Your Discord user ID for developer-only commands. | (none) |
DISCORD_GUILD_BLACKLIST |
Comma-separated guild IDs the bot will leave. | (none) |
Run the Discord bot:
go build -o melodix-discord ./cmd/discord then run the binary. Ensure DISCORD_TOKEN is set (e.g. in .env).melodix-discord (or melodix-discord.exe) binary from the releases archive.After the bot is running and invited to your server, use slash commands in any channel. For music, be in a voice channel and use /music play with a link or search term.
The CLI player uses the same playback engine but runs in your terminal and plays through your speakers. No Discord token or server setup required.
Run the CLI player:
go build -o melodix-cli ./cmd/cli then run the binary.melodix-cli (or melodix-cli.exe) binary from the releases archive.CLI commands (at the > prompt):
| Command | Description |
|---|---|
play <url or query> [source] [parser] |
Add and play (e.g. play https://youtube.com/... or play Never Gonna Give You Up). |
next |
Skip to the next track. |
stop |
Stop playback and clear the queue. |
queue |
Show now playing and the queue. |
status |
Show current track and queue length. |
quit |
Exit. |
Example:
> play Never Gonna Give You Up
> queue
> next
> quit
For help or questions, use the Melodix Discord server.
Melodix is licensed under the MIT License.