@@ -10,68 +10,81 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
10
10
json=$(
11
11
cat << EOF
12
12
{
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
+ }
50
50
EOF
51
51
)
52
52
53
53
if [ -n " ${querytype} " ]; then
54
54
json+=$(
55
55
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
+ }
62
75
EOF
63
76
)
64
77
fi
65
78
66
79
json+=$(
67
80
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
+ ]
75
88
}
76
89
EOF
77
90
)
0 commit comments