From 68d9fbae8a4aa44d98ae5ff722e9c727b2064790 Mon Sep 17 00:00:00 2001 From: celso Date: Wed, 22 Mar 2023 22:16:58 -0300 Subject: [PATCH] fix typo in getusrname --- bashbot-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bashbot-lib.sh b/bashbot-lib.sh index cd0c2c2..e48c5af 100755 --- a/bashbot-lib.sh +++ b/bashbot-lib.sh @@ -88,7 +88,7 @@ getusr_name(){ getusrname(){ local username="$(tail -n 1 "${bot_tmpdir}${1}" | grep -om1\ '"username":"\(\\"\|[^"]*\)*"\(,"language_code"\|},"chat"\)' | head -n1)" - grep "\"language_code\"$" <<< "${username}" >/dev/null && utf-16-surrogate-pair-decode "${user_name:12:-17}"\ + grep "\"language_code\"$" <<< "${username}" >/dev/null && utf-16-surrogate-pair-decode "${username:12:-17}"\ || { grep "},\"chat\"$" <<< "${username}" >/dev/null && utf-16-surrogate-pair-decode "${username:12:-9}" }