melodix

# Header

GoDoc Go report

🎡 Melodix β€” Self-hosted Discord music bot

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.

🌟 Features Overview

🎧 Playback Support

βš™οΈ Additional Features

⚠️ Current Limitations

πŸš€ Try Melodix

You can test out Melodix in two ways:

πŸ“ Available Discord Commands

▢️ Playback Commands

πŸ“‹ Advanced Playback Commands

πŸ“Š Information Commands

βš™οΈ Utility Commands

ℹ️ General Commands

πŸ’‘ Usage Examples

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

πŸ”§ How to Set Up the Bot

πŸ”— Create a Bot in the Discord Developer Portal

To add Melodix to a Discord server, follow these steps:

  1. Create an application in the Discord Developer Portal and obtain the APPLICATION_ID (in the General section).
  2. In the Bot section, enable PRESENCE INTENT, SERVER MEMBERS INTENT, and MESSAGE CONTENT INTENT.
  3. 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.
  4. Select a server and click β€œAuthorize”.
  5. 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.

πŸ› οΈ Building Melodix from Sources

This project is written in Go, so ensure your environment is ready. Use the provided scripts to build Melodix from source:

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.

🐳 Docker Deployment

For Docker deployment, refer to docker/README.md for specific instructions.

πŸ†˜ Support

For any questions, get support in the Official Discord server.

πŸ“œ License

Melodix is licensed under the MIT License.