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

πŸ•―οΈ Information

🎡 Music

βš™οΈ Settings

πŸ’‘ Usage Examples

To use the play command, provide a YouTube video title or URL:

/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

πŸ”§ 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=2150714368
    • 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 and add it to global PATH variable. Install yt-dlp and add it to global PATH variable.

🐳 Docker Deployment

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

πŸ“ Environment Variables

You can configure Melodix using environment variables by creating a .env file in your project root directory. The following variables should be set in your .env file:

# Discord Bot Token (Required)
DISCORD_TOKEN=your-discord-bot-token

πŸ†˜ Support

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

πŸ“œ License

Melodix is licensed under the MIT License.