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}"\ || {