
Melodix is a Discord bot that plays music in voice channels. You can add it to your own server and run it yourself, or try it on the official server. It is written in Go and supports YouTube, SoundCloud, and internet radio streams.
/music play, /help).Limitations: The bot cannot play YouTube live streams or region-locked videos. Not every radio stream format is supported. Playback may occasionally pause or vary slightly when the bot retries with a different stream method.
#bot-spam (or similar) text channel, and use the slash commands there.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
This section is for anyone who wants to host the bot on their own machine or server.
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: your bot token from the Developer Portal
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 bot:
go build ./cmd/discord, then run the produced binary. Ensure DISCORD_TOKEN is set (e.g. in .env)..env (or set DISCORD_TOKEN), and run it.After the bot is running and invited to your server, use slash commands in any channel where the bot can read and send messages. For music, be in a voice channel and use /music play with a link or search term.
For help or questions, use the Melodix Discord server.
Melodix is licensed under the MIT License.