Skip to content

Commit f70e200

Browse files
committed
[JMusicBot] QoL Update & Fixes
Egg: - Updated image to use new yolks Java image. - Removed unused `-Djavax.accessibility.assistive_technologies=" "` flag from startup command. - Updated and added as many Startup Variables as possible for basic/common settings in the `config.txt` file. - Updated the install script to (1.) have more verbose/clear logging, (2.) update old `config.txt` files with newer versions (while retaining the old one for posterity at `config.txt-old`), and (3.) moving the `example_playlist.txt` file to the correct directory. `config.txt` File: - Updated to the latest version. `playlist.txt` File: - Renamed to `example_playlist.txt`. - Updated in general to match Wiki's example. Readme: - Added authors - Added a better bot description. - Improved "Configuration" section. - Added "Updating" section.
1 parent f031a5f commit f70e200

File tree

5 files changed

+193
-56
lines changed

5 files changed

+193
-56
lines changed

bots/discord/jmusicbot/README.md

+77-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,81 @@
11
# JMusicBot
2-
### Their [Github](https://github.com/jagrosh/MusicBot)
3-
A Discord music bot that's easy to set up and run yourself!
2+
___
3+
### Authors / Contributors
4+
<!-- prettier-ignore-start -->
5+
<!-- markdownlint-disable -->
6+
<table>
7+
<tr>
8+
<td align="center">
9+
<a href="https://github.com/jagrosh">
10+
<img src="https://avatars.githubusercontent.com/u/12754382" width="50px;" alt=""/><br /><sub><b>John Grosh</b></sub>
11+
</a>
12+
<br />
13+
<a href="https://github.com/jagrosh/MusicBot/commits?author=jagrosh" title="Codes">💻</a>
14+
<a href="https://github.com/jagrosh/MusicBot/commits?author=jagrosh" title="Original Bot Creator">🤖</a>
15+
</td>
16+
<td align="center">
17+
<a href="https://github.com/parkervcp">
18+
<img src="https://avatars.githubusercontent.com/u/1207679" width="50px;" alt=""/><br /><sub><b>parkervcp</b></sub>
19+
</a>
20+
<br />
21+
<a href="https://github.com/parkervcp/eggs/commits?author=parkervcp" title="Codes">💻</a>
22+
<a href="https://github.com/parkervcp/eggs/commits?author=parkervcp" title="Original Egg Creator">🥚</a>
23+
</td>
24+
<td align="center">
25+
<a href="https://github.com/Software-Noob">
26+
<img src="https://avatars.githubusercontent.com/u/10975908" width="50px;" alt=""/><br /><sub><b>Software-Noob</b></sub>
27+
</a>
28+
<br />
29+
<a href="https://github.com/parkervcp/eggs/commits?author=Software-Noob" title="Codes">💻</a>
30+
<a href="https://github.com/parkervcp/eggs/commits?author=Software-Noob" title="Contributor">💡</a>
31+
</td>
32+
<td align="center">
33+
<a href="https://github.com/Proxymiity">
34+
<img src="https://avatars.githubusercontent.com/u/25194496" width="50px;" alt=""/><br /><sub><b>Proxymiity</b></sub>
35+
</a>
36+
<br />
37+
<a href="https://github.com/parkervcp/eggs/commits?author=Proxymiity" title="Codes">💻</a>
38+
<a href="https://github.com/parkervcp/eggs/commits?author=Proxymiity" title="Contributor">💡</a>
39+
</td>
40+
<td align="center">
41+
<a href="https://github.com/lilkingjr1">
42+
<img src="https://avatars.githubusercontent.com/u/4533989" width="50px;" alt=""/><br /><sub><b>Red-Thirten</b></sub>
43+
</a>
44+
<br />
45+
<a href="https://github.com/parkervcp/eggs/commits?author=lilkingjr1" title="Codes">💻</a>
46+
<a href="https://github.com/parkervcp/eggs/commits?author=iamkubi" title="Contributor">💡</a>
47+
</td>
48+
</tr>
49+
</table>
50+
<!-- markdownlint-enable -->
51+
<!-- prettier-ignore-end -->
452

5-
### Config
6-
7-
Edit the startup variables before starting the bot, otherwise it will fail to start
53+
___
54+
### Bot Description & Features
55+
From the developer's [Github](https://github.com/jagrosh/MusicBot):
56+
> A Discord music bot that's easy to set up and run yourself!
857
58+
- Easy to run
59+
- Fast loading of songs
60+
- No external keys needed (besides a Discord Bot token)
61+
- Smooth playback
62+
- Server-specific setup for the "DJ" role that can moderate the music
63+
- Clean and beautiful menus
64+
- Supports many sites, including YouTube, Soundcloud, and more
65+
- Supports many online radio/streams
66+
- Supports local files
67+
- Playlist support (both web/youtube, and local)
68+
___
69+
### Configuration
70+
- If you can, edit the Startup Variables before starting the bot, because otherwise it will fail to start.
71+
- Most settings found in `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.
72+
___
973
### Server Ports
10-
There are no ports required for JMusicBot
74+
There are no ports required for JMusicBot.
75+
___
76+
### Updating
77+
Re-Installing the server via the panel will do the following:
78+
79+
1. Update the bot to the latest version.
80+
2. Update the `config.txt` file to the latest version, and place the old one at `config.txt-old`.
81+
3. Any local songs will remain and not be touched.

bots/discord/jmusicbot/config.txt

+8-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ owner = 0
2727
// The prefix is used to control the commands
2828
// If you use !!, the play command will be !!play
2929
// If you do not set this, the prefix will be a mention of the bot (@Botname play)
30-
// If you make this blank, the bot will not use a prefix
3130

3231
prefix = "@mention"
3332

@@ -52,7 +51,7 @@ status = ONLINE
5251
// "Playing" status. Note that this will ONLY work if the bot is playing music on ONE guild;
5352
// if the bot is playing on multiple guilds, this will not work.
5453

55-
songinstatus=false
54+
songinstatus = false
5655

5756

5857
// If you set this, the bot will also use this prefix in addition to
@@ -98,6 +97,11 @@ stayinchannel = false
9897

9998
maxtime = 0
10099

100+
// This sets the amount of seconds the bot will stay alone on a voice channel until it
101+
// automatically leaves the voice channel and clears the queue. If not set or set
102+
// to any number less than or equal to zero, the bot won't leave when alone.
103+
104+
alonetimeuntilstop = 0
101105

102106
// This sets an alternative folder to be used as the Playlists folder
103107
// This can be a relative or absolute path
@@ -108,11 +112,11 @@ playlistsfolder = "Playlists"
108112
// By default, the bot will DM the owner if the bot is running and a new version of the bot
109113
// becomes available. Set this to false to disable this feature.
110114

111-
updatealerts=true
115+
updatealerts = true
112116

113117

114118
// Changing this changes the lyrics provider
115-
// Currently available providers: "A-Z Lyrics", "Genius", "MusicMatch"
119+
// Currently available providers: "A-Z Lyrics", "Genius", "MusicMatch", "LyricsFreak"
116120
// At the time of writing, I would recommend sticking with A-Z Lyrics or MusicMatch,
117121
// as Genius tends to have a lot of non-song results and you might get something
118122
// completely unrelated to what you want.
+87-15
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,130 @@
11
{
2-
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
2+
"_comment": "Pterodactyl JMusicBot Egg ~ parkervcp, Software-Noob, Proxymiity, and Red-Thirten ~ 2021-11-29",
33
"meta": {
44
"version": "PTDL_v1",
55
"update_url": null
66
},
7-
"exported_at": "2021-01-29T22:41:09+02:00",
87
"name": "JMusicBot",
98
"author": "[email protected]",
109
"description": "A Discord music bot that's easy to set up and run yourself!",
1110
"features": null,
1211
"images": [
13-
"quay.io\/parkervcp\/pterodactyl-images:debian_openjdk-8-jre"
12+
"ghcr.io\/parkervcp\/yolks:java_8"
1413
],
15-
"startup": "java -Djavax.accessibility.assistive_technologies=\" \" -Dnogui=true -jar JMusicBot.jar",
14+
"file_denylist": [],
15+
"startup": "java -Dnogui=true -jar JMusicBot.jar",
1616
"config": {
17-
"files": "{\r\n \"config.txt\": {\r\n \"parser\": \"file\",\r\n \"find\": {\r\n \"token =\": \"token = \\\"{{env.BOT_TOKEN}}\\\"\",\r\n \"prefix =\": \"prefix = \\\"{{env.BOT_PREFIX}}\\\"\",\r\n \"owner =\": \"owner = \\\"{{env.BOT_OWNER}}\\\"\"\r\n }\r\n }\r\n}",
17+
"files": "{\r\n \"config.txt\": {\r\n \"parser\": \"file\",\r\n \"find\": {\r\n \"token =\": \"token = \\\"{{server.build.env.BOT_TOKEN}}\\\"\",\r\n \"owner =\": \"owner = {{server.build.env.BOT_OWNER}}\",\r\n \"prefix =\": \"prefix = \\\"{{server.build.env.BOT_PREFIX}}\\\"\",\r\n \"game =\": \"game = \\\"{{server.build.env.BOT_GAME}}\\\"\",\r\n \"status =\": \"status = {{server.build.env.BOT_STATUS}}\",\r\n \"songinstatus =\": \"songinstatus = {{server.build.env.BOT_SONG_STATUS}}\",\r\n \"altprefix =\": \"altprefix = \\\"{{server.build.env.BOT_ALT_PREFIX}}\\\"\",\r\n \"npimages =\": \"npimages = {{server.build.env.BOT_NPIMAGES}}\",\r\n \"stayinchannel =\": \"stayinchannel = {{server.build.env.BOT_STAY_IN_CHANNEL}}\",\r\n \"maxtime =\": \"maxtime = {{server.build.env.BOT_MAXTIME}}\",\r\n \"alonetimeuntilstop =\": \"alonetimeuntilstop = {{server.build.env.BOT_ALONE_TIME}}\"\r\n }\r\n }\r\n}",
1818
"startup": "{\r\n \"done\": \"Finished Loading\"\r\n}",
1919
"logs": "{}",
2020
"stop": "^C"
2121
},
2222
"scripts": {
2323
"installation": {
24-
"script": "#!\/bin\/bash\r\n## this is a simple script to use the github API for release versions.\r\n## this requires the egg has a variable for GITHUB_PACKAGE and VERSION\r\n## this supports using oauth\/personal access tokens via GITHUB_USER and GITHUB_OAUTH_TOKEN (both are required.)\r\n## if you are getting hit with GitHub API limit issues then you need to have the user and token set.\r\n\r\napt update\r\napt install -y jq curl\r\n\r\nGITHUB_PACKAGE=\"jagrosh\/MusicBot\"\r\nCONFIG_LINK=\"https:\/\/raw.githubusercontent.com\/parkervcp\/eggs\/master\/bots\/discord\/jmusicbot\/config.txt\"\r\nPLAYLIST_LINK=\"https:\/\/raw.githubusercontent.com\/parkervcp\/eggs\/master\/bots\/discord\/jmusicbot\/playlist.txt\"\r\n\r\nif [ -z \"${GITHUB_USER}\" ] && [ -z \"${GITHUB_OAUTH_TOKEN}\" ] ; then\r\n echo -e \"no github user set, using anon api call\"\r\nelse\r\n echo -e \"user and oauth token set\"\r\n alias curl='curl -u ${GITHUB_USER}:${GITHUB_OAUTH_TOKEN} '\r\nfi\r\n\r\n## get release info and download links\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/${GITHUB_PACKAGE}\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/${GITHUB_PACKAGE}\/releases\")\r\n\r\nif [ -z \"${VERSION}\" ] || [ \"${VERSION}\" == \"latest\" ]; then\r\n DOWNLOAD_LINK=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)\r\nelse\r\n VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .tag_name')\r\n if [ \"${VERSION}\" == \"${VERSION_CHECK}\" ]; then\r\n DOWNLOAD_LINK=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i config)\r\n else\r\n echo -e \"defaulting to the latest release\"\r\n DOWNLOAD_LINK=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)\r\n fi\r\nfi\r\n\r\n[ ! -d \/mnt\/server ] && mkdir \/mnt\/server\r\n\r\ncd \/mnt\/server\r\n\r\nif [ -f JMusicBot.jar ]; then\r\n mv -f JMusicBot.jar JMusicBot.jar-old\r\nfi\r\n\r\ncurl -Lo JMusicBot.jar ${DOWNLOAD_LINK}\r\n\r\nif [ -f config.txt ]; then\r\n echo -e \"config already exists\"\r\nelse\r\n echo -e \"config not found, downloading default config\"\r\n curl -Lo config.txt ${CONFIG_LINK}\r\nfi\r\n\r\nif [ -f playlist.txt ]; then\r\n echo -e \"playlist already exists\"\r\nelse\r\n echo -e \"playlist not found, downloading default playlist\"\r\n curl -Lo playlist.txt ${PLAYLIST_LINK}\r\nfi\r\n\r\necho \"Job's Done\"",
24+
"script": "#!\/bin\/bash\r\n## this is a simple script to use the github API for release versions.\r\n## this requires the egg has a variable for GITHUB_PACKAGE and VERSION\r\n## this supports using oauth\/personal access tokens via GITHUB_USER and GITHUB_OAUTH_TOKEN (both are required.)\r\n## if you are getting hit with GitHub API limit issues then you need to have the user and token set.\r\n\r\napt update\r\napt install -y jq curl\r\n\r\nGITHUB_PACKAGE=\"jagrosh\/MusicBot\"\r\nCONFIG_LINK=\"https:\/\/raw.githubusercontent.com\/parkervcp\/eggs\/master\/bots\/discord\/jmusicbot\/config.txt\"\r\nPLAYLIST_LINK=\"https:\/\/raw.githubusercontent.com\/parkervcp\/eggs\/master\/bots\/discord\/jmusicbot\/example_playlist.txt\"\r\n\r\nif [ -z \"${GITHUB_USER}\" ] && [ -z \"${GITHUB_OAUTH_TOKEN}\" ] ; then\r\n echo -e \"no github user set, using anon api call\"\r\nelse\r\n echo -e \"user and oauth token set\"\r\n alias curl='curl -u ${GITHUB_USER}:${GITHUB_OAUTH_TOKEN} '\r\nfi\r\n\r\n# get release info and download links\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/${GITHUB_PACKAGE}\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/${GITHUB_PACKAGE}\/releases\")\r\n\r\nif [ -z \"${VERSION}\" ] || [ \"${VERSION}\" == \"latest\" ]; then\r\n DOWNLOAD_LINK=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)\r\nelse\r\n VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .tag_name')\r\n if [ \"${VERSION}\" == \"${VERSION_CHECK}\" ]; then\r\n DOWNLOAD_LINK=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i config)\r\n else\r\n echo -e \"defaulting to the latest release\"\r\n DOWNLOAD_LINK=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)\r\n fi\r\nfi\r\n\r\n## JMusicBot Setup\r\n[ ! -d \/mnt\/server ] && mkdir \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ -f JMusicBot.jar ]; then\r\n echo -e \"Updating JMusicBot.jar to latest version...\"\r\n echo -e '\\t(Old version can be found at \"JMusicBot.jar-old\")'\r\n mv -f JMusicBot.jar JMusicBot.jar-old\r\nfi\r\ncurl -sSLo JMusicBot.jar ${DOWNLOAD_LINK}\r\n\r\nif [ -f config.txt ]; then\r\n echo -e \"Updating config.txt to latest version...\"\r\n echo -e '\\t(Old version can be found at \"config.txt-old\")'\r\n mv -f config.txt config.txt-old\r\nfi\r\ncurl -sSLo config.txt ${CONFIG_LINK}\r\n\r\n[ ! -d Playlists ] && mkdir Playlists\r\ncd Playlists\r\nif [ -f example_playlist.txt ]; then\r\n echo -e \"example_playlist.txt already exists. Skipping default download.\"\r\nelse\r\n echo -e \"example_playlist.txt not found. Downloading default example_playlist...\"\r\n curl -sSLo example_playlist.txt ${PLAYLIST_LINK}\r\nfi\r\n\r\necho -e \"\\nJMusicBot Successfully Installed!\"",
2525
"container": "debian:buster-slim",
26-
"entrypoint": "\/bin\/bash"
26+
"entrypoint": "bash"
2727
}
2828
},
2929
"variables": [
3030
{
31-
"name": "Discord Bot Token",
32-
"description": "The token for your discord bot.\r\n\r\nhttps:\/\/discord.com\/developers\/applications\/",
31+
"name": "[REQUIRED] Discord Bot Token",
32+
"description": "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\/",
3333
"env_variable": "BOT_TOKEN",
3434
"default_value": "You need to get a token",
3535
"user_viewable": true,
3636
"user_editable": true,
3737
"rules": "required|string|max:64"
3838
},
39+
{
40+
"name": "[REQUIRED] Bot Owner ID",
41+
"description": "This is the Discord User ID of the bot owner. Learn how to obtain this ID here: https:\/\/jmusicbot.com\/finding-your-user-id\/",
42+
"env_variable": "BOT_OWNER",
43+
"default_value": "Change This To Your Discord User ID",
44+
"user_viewable": true,
45+
"user_editable": true,
46+
"rules": "required|digits:18"
47+
},
3948
{
4049
"name": "Bot Prefix",
41-
"description": "The prefix for the bot.\r\n\r\nDefault is to @mention the bot.",
50+
"description": "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).",
4251
"env_variable": "BOT_PREFIX",
4352
"default_value": "@mention",
4453
"user_viewable": true,
4554
"user_editable": true,
55+
"rules": "nullable|string|max:20"
56+
},
57+
{
58+
"name": "Bot Alternate Prefix",
59+
"description": "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.",
60+
"env_variable": "BOT_ALT_PREFIX",
61+
"default_value": "NONE",
62+
"user_viewable": true,
63+
"user_editable": true,
4664
"rules": "required|string|max:20"
4765
},
4866
{
49-
"name": "Bot Owner ID",
50-
"description": "This is the user ID of the bot owner. It's a long numeric ID, such as 4440512350692326306",
51-
"env_variable": "BOT_OWNER",
52-
"default_value": "Change This To Your Discord User ID",
67+
"name": "Bot Default Game",
68+
"description": "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\".",
69+
"env_variable": "BOT_GAME",
70+
"default_value": "DEFAULT",
71+
"user_viewable": true,
72+
"user_editable": true,
73+
"rules": "nullable|string|max:20"
74+
},
75+
{
76+
"name": "Bot Default Status",
77+
"description": "[ Accepted Values: ONLINE IDLE DND INVISIBLE ] Will modify the default status of bot.",
78+
"env_variable": "BOT_STATUS",
79+
"default_value": "ONLINE",
80+
"user_viewable": true,
81+
"user_editable": true,
82+
"rules": "required|string|in:ONLINE,IDLE,DND,INVISIBLE"
83+
},
84+
{
85+
"name": "Bot Show Song in Status",
86+
"description": "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!",
87+
"env_variable": "BOT_SONG_STATUS",
88+
"default_value": "false",
89+
"user_viewable": true,
90+
"user_editable": true,
91+
"rules": "required|string|in:true,false"
92+
},
93+
{
94+
"name": "Bot Show Images for \"Now Playing\"",
95+
"description": "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.",
96+
"env_variable": "BOT_NPIMAGES",
97+
"default_value": "false",
98+
"user_viewable": true,
99+
"user_editable": true,
100+
"rules": "required|string|in:true,false"
101+
},
102+
{
103+
"name": "Bot Stay In Channel",
104+
"description": "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.",
105+
"env_variable": "BOT_STAY_IN_CHANNEL",
106+
"default_value": "false",
107+
"user_viewable": true,
108+
"user_editable": true,
109+
"rules": "required|string|in:true,false"
110+
},
111+
{
112+
"name": "Bot Alone Time Until Disconnect",
113+
"description": "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.",
114+
"env_variable": "BOT_ALONE_TIME",
115+
"default_value": "0",
116+
"user_viewable": true,
117+
"user_editable": true,
118+
"rules": "required|integer"
119+
},
120+
{
121+
"name": "Bot Max Song Length",
122+
"description": "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.",
123+
"env_variable": "BOT_MAXTIME",
124+
"default_value": "0",
53125
"user_viewable": true,
54126
"user_editable": true,
55-
"rules": "required|string|max:32"
127+
"rules": "required|integer"
56128
}
57129
]
58130
}

0 commit comments

Comments
 (0)