From 31d089fb6cbb7c7227c348b3140e493f3a8e8cca Mon Sep 17 00:00:00 2001 From: celso Date: Wed, 22 Mar 2023 19:09:33 -0300 Subject: [PATCH] implemented callback detection and response --- bot.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bot.sh b/bot.sh index 3c6db0e..a8edf65 100755 --- a/bot.sh +++ b/bot.sh @@ -19,12 +19,14 @@ exec 2>"${bot_tmpdir}/error.log" . ./bashbot-lib/viewer.sh while [ "${1}" == "start" ]; do - grep "\S" <<< $(getupd) >/dev/null || continue + getupd >/dev/null || continue declare -A curmsg getmsg_content curmsg updates.txt view_content curmsg for i in $(awk '{print $1}' ./allowed_ids.txt); do - [ "${curmsg[user_id]}" == "${i}" ] && [ "${curmsg[text]}" == "/start" ] && { + [ "${curmsg[user_id]}" == "${i}" ] && { + [ "${curmsg[callback]}" == "recheck" ] || [ "${curmsg[text]}" == "/start" ] + } && { sendmsg "${curmsg[chat_id]}" $(./getip.sh "${bot_tmpdir}") unset curmsg declare -A curmsg