diff --git a/bashbot.sh b/bashbot.sh index 151ed48..5f15457 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-12-gf2f5e11 +#### $$VERSION$$ v0.90-dev2-13-gcb3f3e3 # # Exit Codes: # - 0 sucess (hopefully) @@ -32,10 +32,8 @@ if [ -t 1 ] && [ "$TERM" != "" ]; then fi # get location and name of bashbot.sh -export SCRIPT SCRIPTDIR MODULEDIR RUNDIR RUNUSER SCRIPT="$0" REALME="${BASH_SOURCE[0]}" - SCRIPTDIR="$(dirname "${REALME}")" RUNDIR="$(dirname "$0")" @@ -56,7 +54,6 @@ fi ADDONDIR="${BASHBOT_ETC:-./addons}" - RUNUSER="${USER}" # USER is overwritten by bashbot array if [ "${SOURCE}" != "yes" ] && [ "$BASHBOT_HOME" = "" ] && ! cd "${RUNDIR}" ; then @@ -132,7 +129,9 @@ ME_URL=$URL'/getMe' UPD_URL=$URL'/getUpdates?offset=' GETFILE_URL=$URL'/getFile' -unset USER +declare -rx SCRIPT SCRIPTDIR MODULEDIR RUNDIR ADDONDIR TOKENFILE BOTADMIN BOTACL DATADIR COUNTFILE +declare -rx BOTTOKEN URL ME_URL UPD_URL GETFILE_URL + declare -ax CMD declare -Ax UPD BOTSENT USER MESSAGE URLS CONTACT LOCATION CHAT FORWARD REPLYTO VENUE iQUERY export res CAPTION @@ -210,7 +209,7 @@ _is_function() [ "$(LC_ALL=C type -t "$1")" = "function" ] } -DELETE_URL=$URL'/deleteMessage' +declare -xr DELETE_URL=$URL'/deleteMessage' delete_message() { sendJson "${1}" 'message_id: '"${2}"'' "${DELETE_URL}" } @@ -323,7 +322,7 @@ Json2Array() { # output ARRAY as JSON.sh style data # $1 ARRAY name, must be declared with "declare -A ARRAY" before calling Array2Json() { - local ARRAY, key + local key declare -n ARRAY="$1" for key in "${!ARRAY[@]}" do diff --git a/modules/answerInline.sh b/modules/answerInline.sh index 30db71d..626bae1 100644 --- a/modules/answerInline.sh +++ b/modules/answerInline.sh @@ -5,7 +5,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-13-gcb3f3e3 # source from commands.sh to use the inline functions diff --git a/modules/chatMember.sh b/modules/chatMember.sh index 4c0d4e3..73a5f12 100644 --- a/modules/chatMember.sh +++ b/modules/chatMember.sh @@ -5,7 +5,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-13-gcb3f3e3 # source from commands.sh to use the member functions diff --git a/modules/sendMessage.sh b/modules/sendMessage.sh index 6f20766..fef5d4b 100644 --- a/modules/sendMessage.sh +++ b/modules/sendMessage.sh @@ -5,7 +5,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-11-g59aa9fc +#### $$VERSION$$ v0.90-dev2-13-gcb3f3e3 # source from commands.sh to use the sendMessage functions