mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-11-25 00:37:34 +00:00
sendMEssage: send_keyboard: send text bigger 4k seperate
This commit is contained in:
parent
a2a3927117
commit
aad42a52fb
@ -6,7 +6,7 @@
|
|||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#
|
#
|
||||||
# shellcheck disable=SC1117
|
# shellcheck disable=SC1117
|
||||||
#### $$VERSION$$ v1.51-0-g6e66a28
|
#### $$VERSION$$ v1.52-dev-2-ga2a3927
|
||||||
|
|
||||||
# will be automatically sourced from bashbot
|
# will be automatically sourced from bashbot
|
||||||
|
|
||||||
@ -144,6 +144,12 @@ send_keyboard() {
|
|||||||
text="$(JsonEscape "$2")"
|
text="$(JsonEscape "$2")"
|
||||||
text='"text":"'"${text//$'\n'/\\n}"'"'
|
text='"text":"'"${text//$'\n'/\\n}"'"'
|
||||||
fi
|
fi
|
||||||
|
# text longer than 4096, send text and keyboard separate
|
||||||
|
if [ "${#2}" -gt 4096 ]; then
|
||||||
|
send_normal_message "$1" "$2"
|
||||||
|
send_keyboard "$1" "..." "$3"
|
||||||
|
return
|
||||||
|
fi
|
||||||
local one_time=', "one_time_keyboard":true' && [ -n "$4" ] && one_time=""
|
local one_time=', "one_time_keyboard":true' && [ -n "$4" ] && one_time=""
|
||||||
# '"text":"$2", "reply_markup": {"keyboard": [ $3 ], "one_time_keyboard": true}'
|
# '"text":"$2", "reply_markup": {"keyboard": [ $3 ], "one_time_keyboard": true}'
|
||||||
sendJson "$1" "${text}"', "reply_markup": {"keyboard": [ '"$3"' ] '"${one_time}"'}' "${MSG_URL}"
|
sendJson "$1" "${text}"', "reply_markup": {"keyboard": [ '"$3"' ] '"${one_time}"'}' "${MSG_URL}"
|
||||||
|
Loading…
Reference in New Issue
Block a user