@@ -10,68 +10,81 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
1010json=$(
1111 cat << EOF
1212{
13- "username": "LinuxGSM",
14- "avatar_url": "https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/data/alert_discord_logo.jpg",
15- "file": "content",
16- "embeds": [
17- {
18- "author": {
19- "name": "LinuxGSM Alert",
20- "url": "",
21- "icon_url": "https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/data/alert_discord_logo.jpg"
22- },
23- "title": "${alerttitle} ",
24- "url": "",
25- "description": "",
26- "color": "${alertcolourdec} ",
27- "type": "content",
28- "thumbnail": {
29- "url": "${alerticon} "
30- },
31- "fields": [
32- {
33- "name": "Server Name",
34- "value": "${servername} "
35- },
36- {
37- "name": "Information",
38- "value": "${alertmessage} "
39- },
40- {
41- "name": "Game",
42- "value": "${gamename} ",
43- "inline": true
44- },
45- {
46- "name": "Server Time",
47- "value": "$( date) ",
48- "inline": true
49- }
13+ "username": "LinuxGSM",
14+ "avatar_url": "https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/data/alert_discord_logo.jpg",
15+ "file": "content",
16+ "embeds": [
17+ {
18+ "author": {
19+ "name": "LinuxGSM Alert",
20+ "url": "",
21+ "icon_url": "https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/data/alert_discord_logo.jpg"
22+ },
23+ "title": "${alerttitle} ",
24+ "url": "",
25+ "description": "",
26+ "color": "${alertcolourdec} ",
27+ "type": "content",
28+ "thumbnail": {
29+ "url": "${alerticon} "
30+ },
31+ "fields": [
32+ {
33+ "name": "Server Name",
34+ "value": "${servername} "
35+ },
36+ {
37+ "name": "Information",
38+ "value": "${alertmessage} "
39+ },
40+ {
41+ "name": "Game",
42+ "value": "${gamename} ",
43+ "inline": true
44+ },
45+ {
46+ "name": "Server Time",
47+ "value": "$( date) ",
48+ "inline": true
49+ }
5050EOF
5151)
5252
5353if [ -n " ${querytype} " ]; then
5454 json+=$(
5555 cat << EOF
56- ,
57- {
58- "name": "Is my Game Server Online?",
59- "value": "https://ismygameserver.online/${imgsoquerytype} /${alertip} :${queryport} ",
60- "inline": true
61- }
56+ ,
57+ {
58+ "name": "Is my Game Server Online?",
59+ "value": "https://ismygameserver.online/${imgsoquerytype} /${alertip} :${queryport} ",
60+ "inline": true
61+ }
62+ EOF
63+ )
64+ fi
65+
66+ if [ -n " {alerturl}" ]; then
67+ json+=$(
68+ cat << EOF
69+ ,
70+ {
71+ "name": "More info",
72+ "value": "${alerturl} ",
73+ "inline": true
74+ }
6275EOF
6376 )
6477fi
6578
6679json+=$(
6780 cat << EOF
68- ],
69- "footer": {
70- "icon_url": "https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/data/alert_discord_logo.jpg",
71- "text": "Sent by LinuxGSM ${version} "
72- }
73- }
74- ]
81+ ],
82+ "footer": {
83+ "icon_url": "https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/data/alert_discord_logo.jpg",
84+ "text": "Sent by LinuxGSM ${version} "
85+ }
86+ }
87+ ]
7588}
7689EOF
7790)
0 commit comments