From f7f55ea45f955b268e58ec843626cd7c7da01694 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Sun, 4 Apr 2021 11:27:39 +0200 Subject: [PATCH] modules: processUpdates: inform user if he is blocked --- modules/processUpdates.sh | 13 ++++++++++--- mycommands.sh | 2 +- mycommands.sh.clean | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/modules/processUpdates.sh b/modules/processUpdates.sh index ddd3d21..8c9dc99 100644 --- a/modules/processUpdates.sh +++ b/modules/processUpdates.sh @@ -4,7 +4,7 @@ # File: processUpdates.sh # Note: DO NOT EDIT! this file will be overwritten on update # -#### $$VERSION$$ v1.51-dev-16-g4c4ba0b +#### $$VERSION$$ v1.51-dev-18-g9b6aba0 ################################################################## ############## @@ -67,9 +67,16 @@ process_update() { # log message on debug [[ -n "${debug}" ]] && log_message "New Message ==========\n$(grep -F '["result",'"${num}" <<<"${UPDATE}")" - # check for users / groups to ignore + # check for users / groups to ignore, inform them ... jssh_updateArray_async "BASHBOTBLOCKED" "${BLOCKEDFILE}" - [ -n "${USER[ID]}" ] && [[ -n "${BASHBOTBLOCKED[${USER[ID]}]}" || -n "${BASHBOTBLOCKED[${CHAT[ID]}]}" ]] && return + if [ -n "${USER[ID]}" ] && [[ -n "${BASHBOTBLOCKED[${USER[ID]}]}" || -n "${BASHBOTBLOCKED[${CHAT[ID]}]}" ]];then + if [ -n "${BASHBOTBLOCKED[${USER[ID]}]}" ]; then + send_normal_message "${USER[ID]}" "User blocked because: ${BASHBOTBLOCKED[${USER[ID]}]}" & + else + send_normal_message "${CHAT[ID]}" "Chat blocked because: ${BASHBOTBLOCKED[${CHAT[ID]}]}" & + fi + return + fi # process per message type if [ -n "${iQUERY[ID]}" ]; then diff --git a/mycommands.sh b/mycommands.sh index c3a05f4..8fe24e9 100644 --- a/mycommands.sh +++ b/mycommands.sh @@ -13,7 +13,7 @@ # License: WTFPLv2 http://www.wtfpl.net/txt/copying/ # Author: KayM (gnadelwartz), kay@rrr.de # -#### $$VERSION$$ v1.51-dev-17-gecaecfe +#### $$VERSION$$ v1.51-dev-18-g9b6aba0 ####################################################### # shellcheck disable=SC1117 diff --git a/mycommands.sh.clean b/mycommands.sh.clean index 156e876..a16f39c 100644 --- a/mycommands.sh.clean +++ b/mycommands.sh.clean @@ -10,7 +10,7 @@ # License: WTFPLv2 http://www.wtfpl.net/txt/copying/ # Author: KayM (gnadelwartz), kay@rrr.de # -#### $$VERSION$$ v1.51-dev-17-gecaecfe +#### $$VERSION$$ v1.51-dev-18-g9b6aba0 ####################################################### # shellcheck disable=SC1117