mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-11-21 23:25:08 +00:00
modules: processUpdates: inform user if he is blocked
This commit is contained in:
parent
9b6aba0586
commit
f7f55ea45f
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user