From 41d6bf52f87ae58974bdd2397f1208c8a4da921b 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 --- bashbot-lib | 2 +- bot.sh | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/bashbot-lib b/bashbot-lib index 660433d..4d0ef59 160000 --- a/bashbot-lib +++ b/bashbot-lib @@ -1 +1 @@ -Subproject commit 660433de36041a28bb9e553c264d257a50c6d0f6 +Subproject commit 4d0ef5998b58c2a7415dbfce1a3320e79b825d8c 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