Skip to content

Commit

Permalink
fix: add missing imgso filter if not required in discord alert
Browse files Browse the repository at this point in the history
  • Loading branch information
dgibbs64 committed Jan 8, 2025
1 parent 8d17622 commit 4a7e0dd
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lgsm/modules/alert_discord.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -63,6 +76,8 @@ json=$(
EOF
)

echo "${json}"

fn_print_dots "Sending Discord alert"

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

0 comments on commit 4a7e0dd

Please sign in to comment.