forked from pelican-eggs/eggs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
egg-j-music-bot.json
130 lines (130 loc) · 10.4 KB
/
egg-j-music-bot.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
{
"_comment": "Pterodactyl JMusicBot Egg ~ parkervcp, Software-Noob, Proxymiity, and Red-Thirten ~ 2021-11-29",
"meta": {
"version": "PTDL_v1",
"update_url": null
},
"name": "JMusicBot",
"author": "[email protected]",
"description": "A Discord music bot that's easy to set up and run yourself!",
"features": null,
"images": [
"ghcr.io\/pterodactyl\/yolks:java_16"
],
"file_denylist": [],
"startup": "java -Dnogui=true -jar JMusicBot.jar",
"config": {
"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}",
"startup": "{\r\n \"done\": \"Finished Loading\"\r\n}",
"logs": "{}",
"stop": "^C"
},
"scripts": {
"installation": {
"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 anonymous 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\necho -e \"\\nInstalling\/Updating JMusicBot...\\n\"\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\necho -e \"Running: curl -sSLo JMusicBot.jar ${DOWNLOAD_LINK}\\n\"\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\necho -e \"Running: curl -sSLo config.txt ${CONFIG_LINK}\\n\"\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 echo -e \"Running: curl -sSLo example_playlist.txt ${PLAYLIST_LINK}\"\r\n curl -sSLo example_playlist.txt ${PLAYLIST_LINK}\r\nfi\r\n\r\necho -e \"\\nJMusicBot Successfully Installed!\"",
"container": "debian:buster-slim",
"entrypoint": "\/bin\/bash"
}
},
"variables": [
{
"name": "[REQUIRED] Discord Bot Token",
"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\/",
"env_variable": "BOT_TOKEN",
"default_value": "You need to get a token",
"user_viewable": true,
"user_editable": true,
"rules": "required|string"
},
{
"name": "[REQUIRED] Bot Owner ID",
"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\/",
"env_variable": "BOT_OWNER",
"default_value": "Change This To Your Discord User ID",
"user_viewable": true,
"user_editable": true,
"rules": "required|digits:18"
},
{
"name": "Bot Prefix",
"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).",
"env_variable": "BOT_PREFIX",
"default_value": "@mention",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string|max:20"
},
{
"name": "Bot Alternate Prefix",
"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.",
"env_variable": "BOT_ALT_PREFIX",
"default_value": "NONE",
"user_viewable": true,
"user_editable": true,
"rules": "required|string|max:20"
},
{
"name": "Bot Default Game",
"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\".",
"env_variable": "BOT_GAME",
"default_value": "DEFAULT",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string|max:20"
},
{
"name": "Bot Default Status",
"description": "[ Accepted Values: ONLINE IDLE DND INVISIBLE ] Will modify the default status of bot.",
"env_variable": "BOT_STATUS",
"default_value": "ONLINE",
"user_viewable": true,
"user_editable": true,
"rules": "required|string|in:ONLINE,IDLE,DND,INVISIBLE"
},
{
"name": "Bot Show Song in Status",
"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!",
"env_variable": "BOT_SONG_STATUS",
"default_value": "false",
"user_viewable": true,
"user_editable": true,
"rules": "required|string|in:true,false"
},
{
"name": "Bot Show Images for \"Now Playing\"",
"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.",
"env_variable": "BOT_NPIMAGES",
"default_value": "false",
"user_viewable": true,
"user_editable": true,
"rules": "required|string|in:true,false"
},
{
"name": "Bot Stay In Channel",
"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.",
"env_variable": "BOT_STAY_IN_CHANNEL",
"default_value": "false",
"user_viewable": true,
"user_editable": true,
"rules": "required|string|in:true,false"
},
{
"name": "Bot Alone Time Until Disconnect",
"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.",
"env_variable": "BOT_ALONE_TIME",
"default_value": "0",
"user_viewable": true,
"user_editable": true,
"rules": "required|integer"
},
{
"name": "Bot Max Song Length",
"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.",
"env_variable": "BOT_MAXTIME",
"default_value": "0",
"user_viewable": true,
"user_editable": true,
"rules": "required|integer"
}
]
}