implemented callback detection and response
This commit is contained in:
parent
c697b07635
commit
6d0a565dc4
6
bot.sh
6
bot.sh
|
@ -19,12 +19,14 @@ exec 2>"${bot_tmpdir}/error.log"
|
||||||
. ./bashbot-lib/viewer.sh
|
. ./bashbot-lib/viewer.sh
|
||||||
|
|
||||||
while [ "${1}" == "start" ]; do
|
while [ "${1}" == "start" ]; do
|
||||||
grep "\S" <<< $(getupd) >/dev/null || continue
|
getupd >/dev/null || continue
|
||||||
declare -A curmsg
|
declare -A curmsg
|
||||||
getmsg_content curmsg updates.txt
|
getmsg_content curmsg updates.txt
|
||||||
view_content curmsg
|
view_content curmsg
|
||||||
for i in $(awk '{print $1}' ./allowed_ids.txt); do
|
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}")
|
sendmsg "${curmsg[chat_id]}" $(./getip.sh "${bot_tmpdir}")
|
||||||
unset curmsg
|
unset curmsg
|
||||||
declare -A curmsg
|
declare -A curmsg
|
||||||
|
|
Loading…
Reference in New Issue