A self-hosted, feature-rich music bot for Discord, built with Java using JDA and LavaPlayer. Stream your favorite tunes seamlessly!
Explore the docs »
Report Bug
·
Request Feature
Important
For a more detailed guide on setting up your Discord bot, we recommend checking out the JDA Getting Started Guide, specifically the Creating a Discord Bot section.
- Go to the Discord Developer Portal
- Create a new application and configure the bot
Note: Feel free to customize your bot's name, avatar, and description to match your preferences!
- In the "Bot" section, enable the following Privileged Gateway Intents:
- Presence Intent
- Server Members Intent
- Message Content Intent
- In the "OAuth2" section, generate an invite URL with the following permissions:
- Scopes:
bot,applications.commands - Bot Permissions:
- View Channels
- Send Messages
- Connect
- Speak
- Use Voice Activity
- Scopes:
- Use the generated URL to invite the bot to your server
- Clone the repository:
git clone https://github.com/DanteZulli/apolo-music-bot.git
cd apolo-music-bot- Configure your environment:
We recommend using direnv with a .envrc file for a more convenient setup (over than overriding token values in docker-compose.yml or .properties files). This configuration is required for both local execution and Docker/Podman.
# .envrc
export DISCORD_BOT_TOKEN=your_discord_token_hereBuild and run the project using Maven:
mvn clean install
mvn spring-boot:runThe project is fully dockerized. You can build and run the bot using Docker Compose or Podman Compose:
# Build and start in background
docker compose up --build -d
# Using Podman
podman compose up --build -dTip
If you notice the bot is running an old version even after code changes, use the --build flag or manually remove the old image with podman image rm apolo-music-bot:latest before running up. We've configured an explicit image name in docker-compose.yml to ensure consistency.
Note
Image references use full registry paths to ensure compatibility with Podman and environments where unqualified-search-registries are not configured (such as Debian)
/play <query>: Plays a song from any source or adds it to the queue/pause: Pauses the current playback/resume: Resumes the paused playback/stop: Stops the playback and clears the queue/skip: Skips the current song and moves to the next one in the queue/queue: Shows the current queue and the track currently playing/help: Displays a list of available commands and their usage
If you like this bot or find the project interesting, don't forget to check out the libraries that made it possible and drop them a star.
- JDA - The Java library for Discord API
- LavaPlayer - Audio player library for Discord bots. We also use the youtube-source manager.
- Special thanks to the original LavaPlayer, which inspired us to start building this bot before migrating to the fork.
Special shoutout to the creators of JMusicBot and FredBoat, whose open-source projects served as excellent references and learning resources.
This project is licensed under the GPL v3 License. See the LICENSE file for details.