mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-05-29 00:10:53 +00:00
fix EVENT typo and order
This commit is contained in:
parent
483da5a797
commit
b60f33afac
|
@ -17,13 +17,13 @@
|
||||||
# Availible events:
|
# Availible events:
|
||||||
# on events startbot and init, this file is sourced
|
# on events startbot and init, this file is sourced
|
||||||
#
|
#
|
||||||
# BASBOT_EVENT_INLINE inline query received
|
# BASHBOT_EVENT_INLINE inline query received
|
||||||
# BASBOT_EVENT_MESSAGE any type of message received
|
# BASHBOT_EVENT_MESSAGE any type of message received
|
||||||
# BASBOT_EVENT_REPLYTO reply to message received
|
# BASHBOT_EVENT_REPLYTO reply to message received
|
||||||
# BASBOT_EVENT_FORWARD forwarded message received
|
# BASHBOT_EVENT_FORWARD forwarded message received
|
||||||
# BASBOT_EVENT_CONTACT contact received
|
# BASHBOT_EVENT_CONTACT contact received
|
||||||
# BASBOT_EVENT_LOCATION location or venue received
|
# BASHBOT_EVENT_LOCATION location or venue received
|
||||||
# BASBOT_EVENT_FILE file received
|
# BASHBOT_EVENT_FILE file received
|
||||||
#
|
#
|
||||||
# all global variables and functions can be used in registered functions.
|
# all global variables and functions can be used in registered functions.
|
||||||
#
|
#
|
||||||
|
@ -36,6 +36,9 @@
|
||||||
# $2 debug: use "[[ "$2" = *"debug"* ]]" if you want to output extra diagnostic
|
# $2 debug: use "[[ "$2" = *"debug"* ]]" if you want to output extra diagnostic
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# export used events
|
||||||
|
export BASHBOT_EVENT_INLINE BASHBOT_EVENT_REPLY
|
||||||
|
|
||||||
# any global variable defined by addons MUST be prefixed by addon name
|
# any global variable defined by addons MUST be prefixed by addon name
|
||||||
EXAMPLE_ME="example"
|
EXAMPLE_ME="example"
|
||||||
|
|
||||||
|
@ -48,7 +51,7 @@ fi
|
||||||
# register on startbot
|
# register on startbot
|
||||||
if [[ "$1" = "start"* ]]; then
|
if [[ "$1" = "start"* ]]; then
|
||||||
# register to inline
|
# register to inline
|
||||||
export BASBOT_EVENT_INLINE["${EXAMPLE_ME}"]="${EXAMPLE_ME}_inline"
|
BASHBOT_EVENT_INLINE["${EXAMPLE_ME}"]="${EXAMPLE_ME}_inline"
|
||||||
|
|
||||||
# any function defined by addons MUST be prefixed by addon name
|
# any function defined by addons MUST be prefixed by addon name
|
||||||
# function local variables can have any name, but must be LOCAL
|
# function local variables can have any name, but must be LOCAL
|
||||||
|
@ -58,7 +61,7 @@ if [[ "$1" = "start"* ]]; then
|
||||||
}
|
}
|
||||||
|
|
||||||
# register to reply
|
# register to reply
|
||||||
export BASBOT_EVENT_REPLY["${EXAMPLE_ME}"]="${EXAMPLE_ME}_reply"
|
BASHBOT_EVENT_REPLY["${EXAMPLE_ME}"]="${EXAMPLE_ME}_reply"
|
||||||
|
|
||||||
# any function defined by addons MUST be prefixed by addon name
|
# any function defined by addons MUST be prefixed by addon name
|
||||||
# function local variables can have any name, but must be LOCAL
|
# function local variables can have any name, but must be LOCAL
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
# This file is public domain in the USA and all free countries.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.90-dev2-0-gec85636
|
#### $$VERSION$$ v0.90-dev2-3-g483da5a
|
||||||
#
|
#
|
||||||
# Exit Codes:
|
# Exit Codes:
|
||||||
# - 0 sucess (hopefully)
|
# - 0 sucess (hopefully)
|
||||||
|
@ -338,9 +338,9 @@ process_client() {
|
||||||
|
|
||||||
# then all registered addons
|
# then all registered addons
|
||||||
if [ "${iQUERY[ID]}" = "" ]; then
|
if [ "${iQUERY[ID]}" = "" ]; then
|
||||||
_is_function process_inline && event_inline "${debug}"
|
|
||||||
else
|
|
||||||
event_message "${debug}"
|
event_message "${debug}"
|
||||||
|
else
|
||||||
|
_is_function process_inline && event_inline "${debug}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# last count users
|
# last count users
|
||||||
|
|
Loading…
Reference in New Issue
Block a user