From ef20b23401b8e57f60dddd772c2f61e35f6d8eb8 Mon Sep 17 00:00:00 2001 From: celso Date: Wed, 22 Mar 2023 11:42:20 -0300 Subject: [PATCH] updated library and implemented allowed_ids --- bashbot-lib | 2 +- bot.sh | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bashbot-lib b/bashbot-lib index d4a4420..b2f3e46 160000 --- a/bashbot-lib +++ b/bashbot-lib @@ -1 +1 @@ -Subproject commit d4a4420972e4e147fb955eec9f729e5774c8dd79 +Subproject commit b2f3e46713fa6fd78f62b37477aa4376fb301b54 diff --git a/bot.sh b/bot.sh index 211a07e..3c6db0e 100755 --- a/bot.sh +++ b/bot.sh @@ -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