Sfoglia il codice sorgente

fix: add missing imgso filter if not required in discord alert

Daniel Gibbs 1 anno fa
parent
commit
7a0fc70d81
1 ha cambiato i file con 14 aggiunte e 1 eliminazioni
  1. 14 1
      lgsm/modules/alert_discord.sh

+ 14 - 1
lgsm/modules/alert_discord.sh

@@ -46,12 +46,25 @@ json=$(
                     "name": "Server Time",
                     "value": "$(date)",
                     "inline": true
-                },
+                }
+EOF
+)
+
+if [ -n "${querytype}" ]; then
+	json+=$(
+		cat << EOF
+                ,
                 {
                     "name": "Is my Game Server Online?",
                     "value": "https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}",
                     "inline": true
                 }
+EOF
+	)
+fi
+
+json+=$(
+	cat << EOF
             ],
             "footer": {
                 "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg",