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

Loading…
Cancel
Save