mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-12-28 12:50:44 +00:00
log updates received on debug
This commit is contained in:
parent
15928bd58f
commit
b6e9f9ed16
10
bashbot.sh
10
bashbot.sh
@ -11,7 +11,7 @@
|
||||
# This file is public domain in the USA and all free countries.
|
||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||
#
|
||||
#### $$VERSION$$ v0.96-pre-36-g81c8771
|
||||
#### $$VERSION$$ v0.96-pre-38-g15928bd
|
||||
#
|
||||
# Exit Codes:
|
||||
# - 0 sucess (hopefully)
|
||||
@ -501,11 +501,15 @@ process_updates() {
|
||||
}
|
||||
process_client() {
|
||||
local num="$1" debug="$2"
|
||||
CMD=( ); iQUERY=( )
|
||||
[[ "${debug}" = *"debug"* ]] && printf "\n%s: New Message ==========\n%s\n" "$(date)" "$UPDATE" >>"${LOGDIR}/MESSAGE.log"
|
||||
CMD=( ); iQUERY=( ); MESSAGE=()
|
||||
iQUERY[ID]="${UPD["result",${num},"inline_query","id"]}"
|
||||
CHAT[ID]="${UPD["result",${num},"message","chat","id"]}"
|
||||
USER[ID]="${UPD["result",${num},"message","from","id"]}"
|
||||
# log message on debug
|
||||
if [[ "${debug}" = *"debug"* ]]; then
|
||||
printf "%s: update received FROM=%s CHAT=%s iQEUERY=%s\n" "$(date)" "${USER[ID]}" "${CHAT[ID]}" "${iQUERY[ID]}"
|
||||
printf "\n%s: New Message ==========\n%s\n" "$(date)" "$UPDATE" >>"${LOGDIR}/MESSAGE.log"
|
||||
fi
|
||||
|
||||
# check for uers / groups to ignore
|
||||
if [ -n "${USER[ID]}" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user