mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-12-28 04:45:00 +00:00
mycommands: better iBUTTONS example
This commit is contained in:
parent
fa0cb75c60
commit
cbf3945e4f
@ -13,7 +13,7 @@
|
|||||||
# License: WTFPLv2 http://www.wtfpl.net/txt/copying/
|
# License: WTFPLv2 http://www.wtfpl.net/txt/copying/
|
||||||
# Author: KayM (gnadelwartz), kay@rrr.de
|
# Author: KayM (gnadelwartz), kay@rrr.de
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v1.35-dev-14-g08a0524
|
#### $$VERSION$$ v1.35-dev-20-gfa0cb75
|
||||||
#######################################################
|
#######################################################
|
||||||
# shellcheck disable=SC1117
|
# shellcheck disable=SC1117
|
||||||
|
|
||||||
@ -203,8 +203,11 @@ else
|
|||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
*) # all other callbacks are processed here
|
*) # all other callbacks are processed here
|
||||||
: # your processing here ...
|
# your processing here ...
|
||||||
:
|
if [[ -n "${iBUTTON[CHAT_ID]}" && -n "${iBUTTON[MESSAGE_ID]}" ]]; then
|
||||||
|
# output random button if message data is available
|
||||||
|
edit_inline_buttons "${iBUTTON[CHAT_ID]}" "${iBUTTON[MESSAGE_ID]}" "Button ${RANDOM}|${RANDOM}"
|
||||||
|
fi
|
||||||
# Telegram needs an ack each callback query, default empty
|
# Telegram needs an ack each callback query, default empty
|
||||||
answer_callback_query "${iBUTTON[ID]}" ""
|
answer_callback_query "${iBUTTON[ID]}" ""
|
||||||
;;
|
;;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
# License: WTFPLv2 http://www.wtfpl.net/txt/copying/
|
# License: WTFPLv2 http://www.wtfpl.net/txt/copying/
|
||||||
# Author: KayM (gnadelwartz), kay@rrr.de
|
# Author: KayM (gnadelwartz), kay@rrr.de
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v1.30-0-g3266427
|
#### $$VERSION$$ v1.35-dev-18-ge4ee880
|
||||||
#######################################################
|
#######################################################
|
||||||
# shellcheck disable=SC1117
|
# shellcheck disable=SC1117
|
||||||
|
|
||||||
@ -77,6 +77,18 @@ else
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mycallbacks() {
|
||||||
|
#######################
|
||||||
|
# callbacks from buttons attached to messages will be processed here
|
||||||
|
case "${iBUTTON[USER_ID]}+${iBUTTON[CHAT_ID]}" in
|
||||||
|
*) # all other callbacks are processed here
|
||||||
|
: # your processing here ...
|
||||||
|
:
|
||||||
|
# Telegram needs an ack each callback query, default empty
|
||||||
|
answer_callback_query "${iBUTTON[ID]}" ""
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
myinlines() {
|
myinlines() {
|
||||||
#######################
|
#######################
|
||||||
# this fuinction is called only if you has set INLINE=1 !!
|
# this fuinction is called only if you has set INLINE=1 !!
|
||||||
|
Loading…
Reference in New Issue
Block a user