From b60f33afac208ad44033879db893120aa5c0add5 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Sun, 26 May 2019 17:40:51 +0200 Subject: [PATCH] fix EVENT typo and order --- addons/example.sh | 21 ++++++++++++--------- bashbot.sh | 6 +++--- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/addons/example.sh b/addons/example.sh index c2f3f4b..86e480c 100644 --- a/addons/example.sh +++ b/addons/example.sh @@ -17,13 +17,13 @@ # Availible events: # on events startbot and init, this file is sourced # -# BASBOT_EVENT_INLINE inline query received -# BASBOT_EVENT_MESSAGE any type of message received -# BASBOT_EVENT_REPLYTO reply to message received -# BASBOT_EVENT_FORWARD forwarded message received -# BASBOT_EVENT_CONTACT contact received -# BASBOT_EVENT_LOCATION location or venue received -# BASBOT_EVENT_FILE file received +# BASHBOT_EVENT_INLINE inline query received +# BASHBOT_EVENT_MESSAGE any type of message received +# BASHBOT_EVENT_REPLYTO reply to message received +# BASHBOT_EVENT_FORWARD forwarded message received +# BASHBOT_EVENT_CONTACT contact received +# BASHBOT_EVENT_LOCATION location or venue received +# BASHBOT_EVENT_FILE file received # # 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 # +# export used events +export BASHBOT_EVENT_INLINE BASHBOT_EVENT_REPLY + # any global variable defined by addons MUST be prefixed by addon name EXAMPLE_ME="example" @@ -48,7 +51,7 @@ fi # register on startbot if [[ "$1" = "start"* ]]; then # 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 # function local variables can have any name, but must be LOCAL @@ -58,7 +61,7 @@ if [[ "$1" = "start"* ]]; then } # 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 # function local variables can have any name, but must be LOCAL diff --git a/bashbot.sh b/bashbot.sh index 1cfa77c..727bf48 100755 --- a/bashbot.sh +++ b/bashbot.sh @@ -11,7 +11,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ v0.90-dev2-0-gec85636 +#### $$VERSION$$ v0.90-dev2-3-g483da5a # # Exit Codes: # - 0 sucess (hopefully) @@ -338,9 +338,9 @@ process_client() { # then all registered addons if [ "${iQUERY[ID]}" = "" ]; then - _is_function process_inline && event_inline "${debug}" - else event_message "${debug}" + else + _is_function process_inline && event_inline "${debug}" fi # last count users