Melodix is my pet project written in Go that plays audio from YouTube and audio streaming links to Discord voice channels. It's a continuation of my original buggy prototype.
- 🎶 Track added by song name or YouTube/Soundcloud link.
- 📻 Internet radio streaming links (24/7 playback).
- 🌐 Operation across multiple Discord servers.
- 📜 Access to recent track statistics and history of
play
commands. - 🔄 Playback auto-resume support for connection interruptions.
- 🚫 The bot cannot play YouTube live streams or region-locked videos.
- ⏸️ Playback auto-resume support may cause noticeable pauses at times.
- ⏩ Playback speed may sometimes slightly vary.
- 🐞 It's not bug-free.
You can test out Melodix in two ways:
-
🖥️ Download compiled binaries (available only for Windows). Ensure FFMPEG is installed on your system and added to the global PATH variable. Follow the "Create bot in Discord Developer Portal" section to set up the bot in Discord.
-
🎙️ Join the Official Discord server and use the voice and
#bot-spam
channels.
!play [title|url]
— Parameters: song name, YouTube URL, audio streaming URL.!skip
— Skip to the next track in the queue.!stop
— Stop playback, clear the queue, and leave the voice channel.
!list
— Show the current song queue.!pause
,!resume
— Pause/resume current playback.
!now
— Show the currently playing song. Convenient for radio streaming.!stats
— Show track statistics with total playback duration and count.!log
— Show recentplay
commands by users.
!set-prefx [new_prefix]
— Set a custom prefix for a guild to avoid collisions with other bots.melodix-reset-prefix
— Revert to the default prefix!
.
!about
— Show bot information.!help
— Show a help cheatsheet.
To use the play
command, provide a YouTube video title or URL:
!play Never Gonna Give You Up
!play https://www.youtube.com/watch?v=dQw4w9WgXcQ
!play http://stream-uk1.radioparadise.com/aac-320
Play multiple tracks (the second link will be added to the queue):
!play https://www.youtube.com/watch?v=dQw4w9WgXcQ https://www.youtube.com/watch?v=OorZcOzNcgE
To add Melodix to a Discord server, follow these steps:
- Create an application in the Discord Developer Portal and obtain the
APPLICATION_ID
(in the General section). - In the Bot section, enable
PRESENCE INTENT
,SERVER MEMBERS INTENT
, andMESSAGE CONTENT INTENT
. - Use the following link to authorize the bot:
discord.com/oauth2/authorize?client_id=YOUR_APPLICATION_ID&scope=bot&permissions=36727824
- Replace
YOUR_APPLICATION_ID
with your Bot's Application ID from step 1.
- Replace
- Select a server and click "Authorize".
- Grant the necessary permissions for Melodix to function correctly (access to text and voice channels).
After adding the bot, build it from source or download compiled binaries. Docker deployment instructions are available in docker/README.md
.
This project is written in Go, so ensure your environment is ready. Use the provided scripts to build Melodix from source:
bash-and-run.bat
(or.sh
for Linux): Build the debug version and execute.build-release.bat
(or.sh
for Linux): Build the release version.build-dist-assemble
: Build the release version and assemble it as a distribution package (Windows only).
Rename .env.example
to .env
and store your Discord Bot Token in the DISCORD_TOKEN
variable.
Install FFMPEG (only recent versions are supported).
Install yt-dlp and add it to global PATH variable.
For Docker deployment, refer to docker/README.md
for specific instructions.
For any questions, get support in the Official Discord server.
Melodix is licensed under the MIT License.