mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-12-27 04:32:49 +00:00
modules: sendMessage: add answer_callback_query
This commit is contained in:
parent
b441384d4a
commit
2222875e2b
@ -6,7 +6,7 @@
|
||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||
#
|
||||
# shellcheck disable=SC1117
|
||||
#### $$VERSION$$ v1.35-dev-3-g461e748
|
||||
#### $$VERSION$$ v1.35-dev-15-gb441384
|
||||
|
||||
# will be automatically sourced from bashbot
|
||||
|
||||
@ -174,6 +174,13 @@ _button_row() {
|
||||
printf "[%s]" "${json}"
|
||||
}
|
||||
|
||||
# $1 callback id, $2 test to show, alert if not empty
|
||||
answer_callback_query() {
|
||||
local alert
|
||||
[ -n "$3" ] && alert='","show_alert": true'
|
||||
sendJson "" '"callback_query_id": "'"$1"'","text":"'"$2${alert}"'"' "${URL}/answerCallbackQuery"
|
||||
}
|
||||
|
||||
# $1 chat, $2 file_id on telegram server
|
||||
send_sticker() {
|
||||
sendJson "$1" '"sticker": "'"$2"'"' "${URL}/sendSticker"
|
||||
|
Loading…
Reference in New Issue
Block a user