Skip to content

Commit 4a7e0dd

Browse files
committed
fix: add missing imgso filter if not required in discord alert
1 parent 8d17622 commit 4a7e0dd

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

lgsm/modules/alert_discord.sh

+16-1
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,25 @@ json=$(
4646
"name": "Server Time",
4747
"value": "$(date)",
4848
"inline": true
49-
},
49+
}
50+
EOF
51+
)
52+
53+
if [ -n "${querytype}" ]; then
54+
json+=$(
55+
cat << EOF
56+
,
5057
{
5158
"name": "Is my Game Server Online?",
5259
"value": "https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}",
5360
"inline": true
5461
}
62+
EOF
63+
)
64+
fi
65+
66+
json+=$(
67+
cat << EOF
5568
],
5669
"footer": {
5770
"icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg",
@@ -63,6 +76,8 @@ json=$(
6376
EOF
6477
)
6578

79+
echo "${json}"
80+
6681
fn_print_dots "Sending Discord alert"
6782

6883
discordsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${discordwebhook}")

0 commit comments

Comments
 (0)