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 f215c1e
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions lgsm/modules/alert_discord.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

json=$(
cat << EOF
cat << EOF
{
"username": "LinuxGSM",
"avatar_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg",
Expand Down 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,9 @@ 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 f215c1e

Please sign in to comment.