From the developer's Github:
A Discord music bot that's easy to set up and run yourself!
config.txt
can 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.There are no ports required for JMusicBot.
Re-Installing the server via the panel will do the following:
config.txt
file to the latest version, and place the old one at config.txt-old
.Name | Tag |
---|---|
ghcr.io/pterodactyl/yolks:java_17 | ghcr.io/pterodactyl/yolks:java_17 |
Name | Description | Environment Variable | Default Value | User Viewable | User Editable |
---|---|---|---|---|---|
[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/ | BOT_TOKEN | Yes | Yes | |
[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/ | BOT_OWNER | Change This To Your Discord User ID | Yes | Yes |
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). | BOT_PREFIX | @mention | Yes | Yes |
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. | BOT_ALT_PREFIX | NONE | Yes | Yes |
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". | BOT_GAME | DEFAULT | Yes | Yes |
Bot Default Status | [ Accepted Values: ONLINE IDLE DND INVISIBLE ] Will modify the default status of bot. | BOT_STATUS | ONLINE | Yes | Yes |
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! | BOT_SONG_STATUS | false | Yes | Yes |
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. | BOT_NPIMAGES | false | Yes | Yes |
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. | BOT_STAY_IN_CHANNEL | false | Yes | Yes |
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. | BOT_ALONE_TIME | 0 | Yes | Yes |
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. | BOT_MAXTIME | 0 | Yes | Yes |
#!/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!"