From 70e2151bcb91a8bc3c0933f5b75413a5c176d0c5 Mon Sep 17 00:00:00 2001 From: Michal Mironczuk Date: Fri, 28 Feb 2025 18:51:50 +0100 Subject: [PATCH] Updated sendMessageToDiscordSmartContractsChannel to sendMessageToSlackSmartContractsChannel --- script/helperFunctions.sh | 16 +++++++--------- script/tasks/diamondEMERGENCYPause.sh | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/script/helperFunctions.sh b/script/helperFunctions.sh index f77d65217..81e38fba4 100755 --- a/script/helperFunctions.sh +++ b/script/helperFunctions.sh @@ -3389,33 +3389,31 @@ function compareAddresses() { return 1 fi } -function sendMessageToDiscordSmartContractsChannel() { +function sendMessageToSlackSmartContractsChannel() { # read function arguments into variable local MESSAGE=$1 - if [ -z "$DISCORD_WEBHOOK_DEV_SMARTCONTRACTS" ]; then + if [ -z "$SLACK_WEBHOOK_SC_GENERAL" ]; then echo "" - warning "Discord webhook URL for dev-smartcontracts is missing. Cannot send log message." + warning "Slack webhook URL for dev-sc-general is missing. Cannot send log message." echo "" return 1 fi echo "" - echoDebug "sending the following message to Discord webhook ('dev-smartcontracts' channel):" + echoDebug "sending the following message to Slack webhook ('dev-sc-general' channel):" echoDebug "$MESSAGE" echo "" # Send the message curl -H "Content-Type: application/json" \ -X POST \ - -d "{\"content\": \"$MESSAGE\"}" \ - $DISCORD_WEBHOOK_DEV_SMARTCONTRACTS + -d "{\"text\": \"$MESSAGE\"}" \ + $SLACK_WEBHOOK_SC_GENERAL - echoDebug "Log message sent to Discord" + echoDebug "Log message sent to Slack" return 0 - - } function getUserInfo() { diff --git a/script/tasks/diamondEMERGENCYPause.sh b/script/tasks/diamondEMERGENCYPause.sh index 35b209544..cb3f57474 100755 --- a/script/tasks/diamondEMERGENCYPause.sh +++ b/script/tasks/diamondEMERGENCYPause.sh @@ -88,7 +88,7 @@ function diamondEMERGENCYPause { # get user info and send message to discord server local USER_INFO=$(getUserInfo) - sendMessageToDiscordSmartContractsChannel ":warning: an emergency diamond action was just triggered (action: $ACTION, user info: $USER_INFO). Please immediately investigate if this action was not planned. :warning:" + sendMessageToSlackSmartContractsChannel ":warning: an emergency diamond action was just triggered (action: $ACTION, user info: $USER_INFO). Please immediately investigate if this action was not planned. :warning:" # Initialize return status local RETURN=0