diff --git a/bashbot.rc b/bashbot.rc index 2555777..9ee685a 100755 --- a/bashbot.rc +++ b/bashbot.rc @@ -5,7 +5,7 @@ # # tested on: ubuntu, opensuse, debian # -#### $$VERSION$$ v1.2-4-g40106ee +#### $$VERSION$$ v1.2-5-g658fac6 # shellcheck disable=SC2009 # shellcheck disable=SC2181 diff --git a/bashbot.sh b/bashbot.sh index 7b7858c..624309e 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$$ v1.2-3-gb0281f1 +#### $$VERSION$$ v1.2-6-g59c51af # # Exit Codes: # - 0 success (hopefully) @@ -605,13 +605,11 @@ title2Json(){ printf '%s\n' "${title}${caption}${desc}${markup}${keyboard}" } -# get bot name +# get bot name and id from telegram getBotName() { - local response declare -A BOTARRAY - response="$(getJson "$ME_URL" | "${JSONSHFILE}" -b -n 2>/dev/null)" - Json2Array 'BOTARRAY' <<<"${response}" - [[ -z "${response}" || -z "${BOTARRAY["result","username"]}" ]] && return 1 + Json2Array 'BOTARRAY' <<<"$(getJson "$ME_URL" | "${JSONSHFILE}" -b -n 2>/dev/null)" + [ -z "${BOTARRAY["result","username"]}" ] && return 1 # save botname and id setConfigKey "botname" "${BOTARRAY["result","username"]}" setConfigKey "botid" "${BOTARRAY["result","id"]}"