reworked functions to correctly handle sentmsgs
This commit is contained in:
parent
cd0723012f
commit
c602c92c15
|
@ -38,7 +38,7 @@ getupd() {
|
||||||
|
|
||||||
getmsg_id() {
|
getmsg_id() {
|
||||||
tail -n1 "${bot_tmpdir}${1}" | grep -om1\
|
tail -n1 "${bot_tmpdir}${1}" | grep -om1\
|
||||||
"\"message\":{\"message_id\":[0-9]\+" | grep -om1 "[0-9]\+"
|
"\"message\":{\"message_id\":[0-9]\+\|^\"message_id\":[0-9]\+" | grep -om1 "[0-9]\+"
|
||||||
}
|
}
|
||||||
|
|
||||||
getusr_id() {
|
getusr_id() {
|
||||||
|
@ -87,8 +87,11 @@ getusr_name(){
|
||||||
|
|
||||||
getusrname(){
|
getusrname(){
|
||||||
local username="$(tail -n 1 "${bot_tmpdir}${1}" | grep -om1\
|
local username="$(tail -n 1 "${bot_tmpdir}${1}" | grep -om1\
|
||||||
'"username":"\(\\"\|[^"]*\)*","language_code"' | head -n1)"
|
'"username":"\(\\"\|[^"]*\)*"\(,"language_code"\|},"chat"\)' | head -n1)"
|
||||||
utf-16-surrogate-pair-decode "${username:12:-17}"
|
grep "\"language_code\"$" <<< "${username}" >/dev/null && utf-16-surrogate-pair-decode "${user_name:12:-17}"\
|
||||||
|
|| {
|
||||||
|
grep "},\"chat\"$" <<< "${username}" >/dev/null && utf-16-surrogate-pair-decode "${username:12:-9}"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getchat_title(){
|
getchat_title(){
|
||||||
|
|
Loading…
Reference in New Issue