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 0aecf3fa5b
commit f8935e75fc
1 changed files with 4 additions and 4 deletions

View File

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