updated library and implemented allowed_ids

This commit is contained in:
celso 2023-03-22 11:42:20 -03:00
parent d91af780ec
commit abeef519a6
1 changed files with 9 additions and 7 deletions

16
bot.sh
View File

@ -23,12 +23,14 @@ while [ "${1}" == "start" ]; do
declare -A curmsg
getmsg_content curmsg updates.txt
view_content curmsg
[ "${curmsg[text]}" == "/start" ] && {
sendmsg "${curmsg[chat_id]}" $(./getip.sh "${bot_tmpdir}")
unset curmsg
declare -A curmsg
getmsg_content curmsg sentmsgs.txt
tput setaf 3; view_content curmsg; tput sgr0
}
for i in $(awk '{print $1}' ./allowed_ids.txt); do
[ "${curmsg[user_id]}" == "${i}" ] && [ "${curmsg[text]}" == "/start" ] && {
sendmsg "${curmsg[chat_id]}" $(./getip.sh "${bot_tmpdir}")
unset curmsg
declare -A curmsg
getmsg_content curmsg sentmsgs.txt
tput setaf 3; view_content curmsg; tput sgr0
}
done
unset curmsg
done