From e10ee614ed56a88d4874b2327ea11b6bdb1ceda1 Mon Sep 17 00:00:00 2001 From: celso Date: Wed, 22 Mar 2023 08:19:55 -0300 Subject: [PATCH] updated library and added sentmsgs to viewer --- bot.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bot.sh b/bot.sh index f7f1d55..211a07e 100755 --- a/bot.sh +++ b/bot.sh @@ -21,9 +21,14 @@ exec 2>"${bot_tmpdir}/error.log" while [ "${1}" == "start" ]; do grep "\S" <<< $(getupd) >/dev/null || continue declare -A curmsg -# =( [msg_id]="$(getmsg_id)" [user_id]="$(getusr_id)" [chat_id]="$(getchat_id)" [text]="$(gettext)" ) - getmsg_content curmsg + getmsg_content curmsg updates.txt view_content curmsg - [ "${curmsg[text]}" == "/start" ] && sendmsg "${curmsg[chat_id]}" $(./getip.sh "${bot_tmpdir}") + [ "${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 + } unset curmsg done