modules: processUpdates: inform user if he is blocked

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2021-04-04 11:27:39 +02:00
parent 9b6aba0586
commit f7f55ea45f
3 changed files with 12 additions and 5 deletions

View File

@ -4,7 +4,7 @@
# File: processUpdates.sh # File: processUpdates.sh
# Note: DO NOT EDIT! this file will be overwritten on update # 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 # log message on debug
[[ -n "${debug}" ]] && log_message "New Message ==========\n$(grep -F '["result",'"${num}" <<<"${UPDATE}")" [[ -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}" 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 # process per message type
if [ -n "${iQUERY[ID]}" ]; then if [ -n "${iQUERY[ID]}" ]; then

View File

@ -13,7 +13,7 @@
# License: WTFPLv2 http://www.wtfpl.net/txt/copying/ # License: WTFPLv2 http://www.wtfpl.net/txt/copying/
# Author: KayM (gnadelwartz), kay@rrr.de # Author: KayM (gnadelwartz), kay@rrr.de
# #
#### $$VERSION$$ v1.51-dev-17-gecaecfe #### $$VERSION$$ v1.51-dev-18-g9b6aba0
####################################################### #######################################################
# shellcheck disable=SC1117 # shellcheck disable=SC1117

View File

@ -10,7 +10,7 @@
# License: WTFPLv2 http://www.wtfpl.net/txt/copying/ # License: WTFPLv2 http://www.wtfpl.net/txt/copying/
# Author: KayM (gnadelwartz), kay@rrr.de # Author: KayM (gnadelwartz), kay@rrr.de
# #
#### $$VERSION$$ v1.51-dev-17-gecaecfe #### $$VERSION$$ v1.51-dev-18-g9b6aba0
####################################################### #######################################################
# shellcheck disable=SC1117 # shellcheck disable=SC1117