mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-11-25 00:37:34 +00:00
modules: processUpdates: optimize inform user if blocked
This commit is contained in:
parent
f7f55ea45f
commit
e4c13ddabe
@ -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-18-g9b6aba0
|
#### $$VERSION$$ v1.51-dev-19-gf7f55ea
|
||||||
##################################################################
|
##################################################################
|
||||||
|
|
||||||
##############
|
##############
|
||||||
@ -62,7 +62,7 @@ process_multi_updates() {
|
|||||||
# processing of a single array item of update
|
# processing of a single array item of update
|
||||||
# $1 array index
|
# $1 array index
|
||||||
process_update() {
|
process_update() {
|
||||||
local num="$1" debug="$2"
|
local chatuser="User" num="$1" debug="$2"
|
||||||
pre_process_message "${num}"
|
pre_process_message "${num}"
|
||||||
# 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}")"
|
||||||
@ -70,11 +70,9 @@ process_update() {
|
|||||||
# check for users / groups to ignore, inform them ...
|
# check for users / groups to ignore, inform them ...
|
||||||
jssh_updateArray_async "BASHBOTBLOCKED" "${BLOCKEDFILE}"
|
jssh_updateArray_async "BASHBOTBLOCKED" "${BLOCKEDFILE}"
|
||||||
if [ -n "${USER[ID]}" ] && [[ -n "${BASHBOTBLOCKED[${USER[ID]}]}" || -n "${BASHBOTBLOCKED[${CHAT[ID]}]}" ]];then
|
if [ -n "${USER[ID]}" ] && [[ -n "${BASHBOTBLOCKED[${USER[ID]}]}" || -n "${BASHBOTBLOCKED[${CHAT[ID]}]}" ]];then
|
||||||
if [ -n "${BASHBOTBLOCKED[${USER[ID]}]}" ]; then
|
[ -n "${BASHBOTBLOCKED[${USER[ID]}]}" ] && chatuser="User"
|
||||||
send_normal_message "${USER[ID]}" "User blocked because: ${BASHBOTBLOCKED[${USER[ID]}]}" &
|
[ "${NOTIFY_BLOCKED_USERS}" == "yes" ] &&\
|
||||||
else
|
send_normal_message "${CHAT[ID]}" "${chatuser} blocked because: ${BASHBOTBLOCKED[${USER[ID]}]} ${BASHBOTBLOCKED[${CHAT[ID]}]}" &
|
||||||
send_normal_message "${CHAT[ID]}" "Chat blocked because: ${BASHBOTBLOCKED[${CHAT[ID]}]}" &
|
|
||||||
fi
|
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# Author: KayM (gnadelwartz), kay@rrr.de
|
# Author: KayM (gnadelwartz), kay@rrr.de
|
||||||
# Created: 09.01.2021 07:27
|
# Created: 09.01.2021 07:27
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v1.5-0-g8adca9b
|
#### $$VERSION$$ v1.51-dev-19-gf7f55ea
|
||||||
#######################################################
|
#######################################################
|
||||||
|
|
||||||
##########
|
##########
|
||||||
@ -96,6 +96,9 @@ WELCOME_MSG="Welcome"
|
|||||||
# export REPORT_NEWMEMBER="yes"
|
# export REPORT_NEWMEMBER="yes"
|
||||||
# export REPORT_LEFTMEMBER="yes"
|
# export REPORT_LEFTMEMBER="yes"
|
||||||
|
|
||||||
|
# uncomment to send user blocked by bot a warning if they send commands
|
||||||
|
# export NOTIFY_BLOCKED_USERS="yes"
|
||||||
|
|
||||||
# messages for admin only commands
|
# messages for admin only commands
|
||||||
NOTADMIN="Sorry, this command is allowed for admin or owner only"
|
NOTADMIN="Sorry, this command is allowed for admin or owner only"
|
||||||
NOTBOTADMIN="Sorry, this command is allowed for bot owner only"
|
NOTBOTADMIN="Sorry, this command is allowed for bot owner only"
|
||||||
|
@ -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-18-g9b6aba0
|
#### $$VERSION$$ v1.51-dev-19-gf7f55ea
|
||||||
#######################################################
|
#######################################################
|
||||||
# shellcheck disable=SC1117
|
# shellcheck disable=SC1117
|
||||||
|
|
||||||
|
@ -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-18-g9b6aba0
|
#### $$VERSION$$ v1.51-dev-19-gf7f55ea
|
||||||
#######################################################
|
#######################################################
|
||||||
# shellcheck disable=SC1117
|
# shellcheck disable=SC1117
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user