Browse Source

fix(alert_discord): reorder fields in Discord alert JSON

* Changed the order of fields in the Discord alert JSON structure.
* Updated the "More info" and "Is my Game Server Online?" fields for better clarity.
pull/4854/head
Daniel Gibbs 7 months ago
parent
commit
b25fabf52b
Failed to extract signature
  1. 17
      lgsm/modules/alert_discord.sh

17
lgsm/modules/alert_discord.sh

@ -43,34 +43,33 @@ json=$(
"inline": true "inline": true
}, },
{ {
"name": "Server Time", "name": "Address:Port",
"value": "$(date)", "value": "\`${alertip}:${port}\`",
"inline": true "inline": true
} }
EOF EOF
) )
if [ -n "${querytype}" ]; then if [ -n "${alerturl}" ]; then
json+=$( json+=$(
cat << EOF cat << EOF
, ,
{ {
"name": "Is my Game Server Online?", "name": "More info",
"value": "https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}", "value": "${alerturl}",
"inline": true "inline": true
} }
EOF EOF
) )
fi fi
if [ -n "${alerturl}" ]; then if [ -n "${querytype}" ]; then
json+=$( json+=$(
cat << EOF cat << EOF
, ,
{ {
"name": "More info", "name": "Is my Game Server Online?",
"value": "${alerturl}", "value": "https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}"
"inline": true
} }
EOF EOF
) )

Loading…
Cancel
Save