From 7610913f3865bf4be4e3d2a7140d92d6c6b18dd5 Mon Sep 17 00:00:00 2001 From: celso Date: Fri, 26 Jul 2024 09:03:26 -0300 Subject: [PATCH] fixed getreplytext getting the wrong text --- bashbot-lib.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bashbot-lib.sh b/bashbot-lib.sh index 3317dd1..6abe9f0 100755 --- a/bashbot-lib.sh +++ b/bashbot-lib.sh @@ -140,7 +140,8 @@ getreplyusrname(){ } getreplytext() { - grep "reply_to_message" "${bot_tmpdir}${1}" >/dev/null && local replytext="$(tail -n 1 "${bot_tmpdir}${1}" | grep -om1\ + tail -n1 "${bot_tmpdir}${1}" | grep "reply_to_message" >/dev/null || return 1 + local replytext="$(tail -n 1 "${bot_tmpdir}${1}" | grep -om1\ '{\?\("text"\|"caption"\):"\(\\"\|[^"]*\)*"\(,\|}\)' | grep -v "^{" | head -n1)" grep "^\"text\"" <<< "${replytext}" >/dev/null && utf-16-surrogate-pair-decode "${replytext:8:-2}"\ || {