Просмотр исходного кода

further developments to alert_discord.sh

Daniel Gibbs 9 лет назад
Родитель
Сommit
48f001be26
1 измененных файлов с 1 добавлено и 13 удалено
  1. 1 13
      lgsm/functions/alert_discord.sh

+ 1 - 13
lgsm/functions/alert_discord.sh

@@ -5,16 +5,4 @@
 # Website: https://gameservermanagers.com
 # Description: Sends Discord alert including the server status.
 
-if [ "$1" == "" ]; then  echo "missing message"; exit; fi
-prefix='{"content":"'
-postfix='","file":"content","embed":"content"}'
-echo "$prefix $1 $postfix" >f
-curl -v -X POST --data @f "${discordwebhook}"
-
-#if [ "${discordsend}" == "invalid_access_token" ]; then
-#	fn_print_fail_nl "Sending Discord alert: invalid_access_token"
-#	fn_script_log_fatal "Sending Discord alert: invalid_access_token"
-#else
-#	fn_print_ok_nl "Sending Discord alert"
-#	fn_script_log_pass "Sent Discord alert"
-#fi
+curl -X POST --data '{ "embeds": [{"title": "${pbalertsubject}", "url": "https://example.com", "description": "${pbalertbody}", "type": "link", "thumbnail": {"url": "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/images/logo/lgsm-square-184-dark.png"}}] }' -H "Content-Type: application/json" "${discordwebhook}"