JMusicBot
A Discord music bot that's easy to set up and run yourself!
Install
- Installer image
- ghcr.io/ptero-eggs/installers:debian
- Install script
- 66 lines
Image
- Java 17 ghcr.io/pterodactyl/yolks:java_17
Startup
The Panel runs this command to start the server. It replaces each variable in the command with the value of that variable.
11 variables
Startup command
java -Dnogui=true -jar JMusicBot.jarThe 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_TOKENUsers can edit
required|stringA value is required.
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_OWNERUsers can edit
required|digits_between:17,18Use 17 to 18 digits.
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_PREFIXUsers can edit
nullable|string|max:20
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_PREFIXUsers can edit
required|string|max:20
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_GAMEUsers can edit
nullable|string|max:20
[ Accepted Values: ONLINE IDLE DND INVISIBLE ] Will modify the default status of bot.
BOT_STATUSUsers can edit
required|string|in:ONLINE,IDLE,DND,INVISIBLE
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_STATUSUsers can edit
required|string|in:true,false
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_NPIMAGESUsers can edit
required|string|in:true,false
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_CHANNELUsers can edit
required|string|in:true,false
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_TIMEUsers can edit
required|integer
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_MAXTIMEUsers can edit
required|integer
Wings
- Stop command
- ^C (SIGINT)
- Running when the console shows
- Finished Loading
Files Wings edits
Wings sets these values in these files before each start.
config.txt file
- token =
- token = "{{server.build.env.BOT_TOKEN}}"
- owner =
- owner = {{server.build.env.BOT_OWNER}}
- prefix =
- prefix = "{{server.build.env.BOT_PREFIX}}"
- game =
- game = "{{server.build.env.BOT_GAME}}"
- status =
- status = {{server.build.env.BOT_STATUS}}
- songinstatus =
- songinstatus = {{server.build.env.BOT_SONG_STATUS}}
- altprefix =
- altprefix = "{{server.build.env.BOT_ALT_PREFIX}}"
- npimages =
- npimages = {{server.build.env.BOT_NPIMAGES}}
- stayinchannel =
- stayinchannel = {{server.build.env.BOT_STAY_IN_CHANNEL}}
- maxtime =
- maxtime = {{server.build.env.BOT_MAXTIME}}
- alonetimeuntilstop =
- alonetimeuntilstop = {{server.build.env.BOT_ALONE_TIME}}
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.
Problem with this egg?
Open an issue on GitHub. Include your Panel and Wings versions.
Install script 66 lines /bin/bash in ghcr.io/ptero-eggs/installers:debian Show Hide
#!/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!"