JMusicBot
ApplicationsA Discord music bot that's easy to set up and run yourself!
README
JMusicBot
Authors / Contributors
Bot Description & Features
From the developer's Github:
A Discord music bot that's easy to set up and run yourself!
- Easy to run
- Fast loading of songs
- No external keys needed (besides a Discord Bot token)
- Smooth playback
- Server-specific setup for the "DJ" role that can moderate the music
- Clean and beautiful menus
- Supports many sites, including YouTube, Soundcloud, and more
- Supports many online radio/streams
- Supports local files
- Playlist support (both web/youtube, and local)
Configuration
- If you can, edit the Startup Variables before starting the bot, because otherwise it will fail to start.
- Most settings found in
config.txtcan be edited via the Startup Variables. Advanced settings not listed can still be edited manually via the File Manager. Available Startup Variables will take precedent over manual edits.
Server Ports
There are no ports required for JMusicBot.
Updating
Re-Installing the server via the panel will do the following:
- Update the bot to the latest version.
- Update the
config.txtfile to the latest version, and place the old one atconfig.txt-old. - Any local songs will remain and not be touched.
Docker Images (1)
| Name | Image |
|---|---|
ghcr.io/pterodactyl/yolks:java_17 | ghcr.io/pterodactyl/yolks:java_17 |
Startup Command
java -Dnogui=true -jar JMusicBot.jar Variables (11)
[REQUIRED] Discord Bot Token
The token for your Discord bot. Learn how to obtain a token and configure your bot application properly here: https://jmusicbot.com/getting-a-bot-token/
- Environment:
BOT_TOKEN- Default:
None- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string
[REQUIRED] Bot Owner ID
This is the Discord User ID of the bot owner. Learn how to obtain this ID here: https://jmusicbot.com/finding-your-user-id/
- Environment:
BOT_OWNER- Default:
Change This To Your Discord User ID- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|digits_between:17,18
Bot Prefix
This sets the prefix for the bot. The prefix is used to control the commands. If you use !, the play command will be !play. If you do not set this, the prefix will be a mention of the bot (@Botname play).
- Environment:
BOT_PREFIX- Default:
@mention- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
nullable|string|max:20
Bot Alternate Prefix
If you set this, the bot will also use this prefix in addition to "Bot Prefix". Set to NONE to not have an alternate prefix.
- Environment:
BOT_ALT_PREFIX- Default:
NONE- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|max:20
Bot Default Game
If you change this, it modifies the default game of the bot. Set this to NONE to have no game. Set this to DEFAULT to use the default game. You can make the game "Playing X", "Listening to X", or "Watching X" where X is the title. If you don't include an action, it will use the default of "Playing".
- Environment:
BOT_GAME- Default:
DEFAULT- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
nullable|string|max:20
Bot Default Status
[ Accepted Values: ONLINE IDLE DND INVISIBLE ] Will modify the default status of bot.
- Environment:
BOT_STATUS- Default:
ONLINE- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|in:ONLINE,IDLE,DND,INVISIBLE
Bot Show Song in Status
If you set this to true, the bot will list the title of the song it is currently playing in its "Playing" status. NOTE: This will ONLY work if the bot is playing music on ONE Discord server; if the bot is playing in multiple servers, this will not work!
- Environment:
BOT_SONG_STATUS- Default:
false- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|in:true,false
Bot Show Images for "Now Playing"
If set to true, the "nowplaying" command will show YouTube thumbnails. NOTE: If you set this to true, the nowplaying boxes will NOT refresh. This is because refreshing the boxes causes the image to be reloaded every time it refreshes.
- Environment:
BOT_NPIMAGES- Default:
false- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|in:true,false
Bot Stay In Channel
If set to true, the bot will not leave a voice channel after it finishes a queue. Keep in mind that being connected to a voice channel uses additional bandwidth, so this option is not recommended if bandwidth is a concern.
- Environment:
BOT_STAY_IN_CHANNEL- Default:
false- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|in:true,false
Bot Alone Time Until Disconnect
This sets the amount of seconds the bot will stay alone on a voice channel until it automatically leaves the voice channel and clears the queue. If not set or set to any number less than or equal to zero, the bot won't leave when alone.
- Environment:
BOT_ALONE_TIME- Default:
0- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|integer
Bot Max Song Length
This sets the maximum amount of seconds any track loaded can be. If not set or set to any number less than or equal to zero, there is no maximum time length. This time restriction applies to songs loaded from any source.
- Environment:
BOT_MAXTIME- Default:
0- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|integer
Installation Script
ghcr.io/ptero-eggs/installers:debian/bin/bash#!/bin/bash
apt update
apt install -y jq curl
CONFIG_LINK="https://raw.githubusercontent.com/ptero-eggs/application-eggs/main/bots/discord/jmusicbot/config.txt"
PLAYLIST_LINK="https://raw.githubusercontent.com/ptero-eggs/application-eggs/main/bots/discord/jmusicbot/example_playlist.txt"
if [ -z "${GITHUB_USER}" ] && [ -z "${GITHUB_OAUTH_TOKEN}" ] ; then
echo -e "using anon api call"
else
echo -e "user and oauth token set"
alias curl='curl -u ${GITHUB_USER}:${GITHUB_OAUTH_TOKEN} '
fi
## get release info and download links
LATEST_JSON=$(curl --silent "https://api.github.com/repos/jagrosh/MusicBot/releases/latest")
RELEASES=$(curl --silent "https://api.github.com/repos/jagrosh/MusicBot/releases")
MATCH=JMusicBot
if [ -z "${VERSION}" ] || [ "${VERSION}" == "latest" ]; then
DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i ${MATCH})
else
VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION "${VERSION}" '.[] | select(.tag_name==$VERSION) | .tag_name')
if [ "${VERSION}" == "${VERSION_CHECK}" ]; then
DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION "${VERSION}" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH})
else
echo -e "defaulting to latest release"
DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)
fi
fi
## JMusicBot Setup
[ ! -d /mnt/server ] && mkdir /mnt/server
cd /mnt/server
echo -e "\nInstalling/Updating JMusicBot...\n"
if [ -f JMusicBot.jar ]; then
echo -e "Updating JMusicBot.jar to latest version..."
echo -e '\t(Old version can be found at "JMusicBot.jar-old")'
mv -f JMusicBot.jar JMusicBot.jar-old
fi
echo -e "Running: curl -sSLo JMusicBot.jar ${DOWNLOAD_URL}\n"
curl -sSLo JMusicBot.jar ${DOWNLOAD_URL}
if [ -f config.txt ]; then
echo -e "Updating config.txt to latest version..."
echo -e '\t(Old version can be found at "config.txt-old")'
mv -f config.txt config.txt-old
fi
echo -e "Running: curl -sSLo config.txt ${CONFIG_LINK}\n"
curl -sSLo config.txt ${CONFIG_LINK}
[ ! -d Playlists ] && mkdir Playlists
cd Playlists
if [ -f example_playlist.txt ]; then
echo -e "example_playlist.txt already exists. Skipping default download."
else
echo -e "example_playlist.txt not found. Downloading default example_playlist..."
echo -e "Running: curl -sSLo example_playlist.txt ${PLAYLIST_LINK}"
curl -sSLo example_playlist.txt ${PLAYLIST_LINK}
fi
echo -e "\nJMusicBot Successfully Installed!"