made getcbk_data implementation-agnostic and also it works now

This commit is contained in:
celso 2023-03-22 19:08:42 -03:00
parent 1a942bbde9
commit 1da6cf48d3
1 changed files with 4 additions and 4 deletions

View File

@ -101,11 +101,10 @@ getchat_title(){
|| getusr_name "${1}"
}
get_cbks() {
getcbk_data() {
local callbacks="$(tail -n 1 "${bot_tmpdir}${1}"\
| grep "\"callback_query\"" | grep "\"callback_data\":\"recheck\"")"
[ ! -z "${callbacks}" ] && is_callback=0 && printf "%s\n" "${callbacks}"\
>> "${bot_tmpdir}callbacks.txt"
| grep "\"callback_query\"" | grep -om1 '"data":"\(\\"\|[^"]*\)*"}')"
[ ! -z "${callbacks}" ] && utf-16-surrogate-pair-decode "${callbacks:8:-2}"
}
sendmsg() {
@ -146,4 +145,5 @@ getmsg_content(){
_REF[chat_title]="$(getchat_title "${2}")"
_REF[msg_id]="$(getmsg_id "${2}")"
_REF[text]="$(gettext "${2}")"
_REF[callback]="$(getcbk_data "${2}")"
}