diff --git a/addons/antiFlood.sh b/addons/antiFlood.sh index 25b09f6..93e30f3 100644 --- a/addons/antiFlood.sh +++ b/addons/antiFlood.sh @@ -4,7 +4,7 @@ # this addon counts how many files, e.g. stickers, are sent to # a chat and takes actions if threshold is reached # -#### $$VERSION$$ v0.94-dev3-0-geef955a +#### $$VERSION$$ v0.94-pre-3-g0e75138 # used events: # @@ -99,7 +99,7 @@ if [[ "$1" = "start"* ]]; then antiFlood_multievent(){ # not started - [ "${ANTIFL_CHATS["${CHAT[ID]}","level"]}" = "" ] && return + [ -z "${ANTIFL_CHATS["${CHAT[ID]}","level"]}" ] && return # count user flood text if [ "$1" = "text" ]; then if [ "${#MESSAGE[0]}" -gt "${ANTIFL_CHATS["${CHAT[ID]}","level"]}" ]; then diff --git a/bashbot.sh b/bashbot.sh index b5775a0..b51dc04 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.94-pre-2-gc0a633f +#### $$VERSION$$ v0.94-pre-3-g0e75138 # # Exit Codes: # - 0 sucess (hopefully) diff --git a/commands.sh b/commands.sh index 8944243..eb01970 100644 --- a/commands.sh +++ b/commands.sh @@ -15,7 +15,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.94-pre-2-gc0a633f +#### $$VERSION$$ v0.94-pre-3-g0e75138 # # adjust your language setting here, e.g.when run from other user or cron. @@ -51,7 +51,7 @@ Get the code in my [GitHub](http://github.com/topkecleon/telegram-bot-bash) ' # load modues on startup and always on on debug -if [ "${1}" != "" ]; then +if [ -n "${1}" ]; then # load all readable modules for modules in "${MODULEDIR:-.}"/*.sh ; do if [[ "${1}" == *"debug"* ]] || ! _is_function "$(basename "${modules}")"; then @@ -74,10 +74,10 @@ export FILE_REGEX='/home/user/allowed/.*' [ -r "${BASHBOT_ETC:-.}/mycommands.sh" ] && source "${BASHBOT_ETC:-.}/mycommands.sh" "${1}" -if [ "${1}" = "" ] || [[ "${1}" == *"debug"* ]];then +if [ -z "${1}" ] || [[ "${1}" == *"debug"* ]];then # detect inline commands.... # no default commands, all processing is done in myinlines() - if [ "$INLINE" != "0" ] && [ "${iQUERY[ID]}" != "" ]; then + if [ "$INLINE" != "0" ] && [ -n "${iQUERY[ID]}" ]; then # forward iinline query to optional dispatcher _exec_if_function myinlines diff --git a/mycommands.sh b/mycommands.sh index 40953d0..0e27afc 100644 --- a/mycommands.sh +++ b/mycommands.sh @@ -8,7 +8,7 @@ # #### if you start to develop your own bot, use the clean version of this file: # #### mycommands.clean # -#### $$VERSION$$ v0.94-pre-0-gac2ec02 +#### $$VERSION$$ v0.94-pre-3-g0e75138 # # uncomment the following lines to overwrite info and help messages @@ -55,7 +55,7 @@ else ############## # a service Message was recieved # add your own stuff here - if [[ "${SERVICE}" != "" ]]; then + if [ -n "${SERVICE}" ]; then # example: delete every service message if [ "${SILENCER}" = "yes" ]; then diff --git a/mycommands.sh.clean b/mycommands.sh.clean index 49cf6b7..a824a3d 100644 --- a/mycommands.sh.clean +++ b/mycommands.sh.clean @@ -4,7 +4,7 @@ # files: mycommands.sh.clean # copy to mycommands.sh and add all your commands and functions here ... # -#### $$VERSION$$ v0.94-pre-0-gac2ec02 +#### $$VERSION$$ v0.94-pre-3-g0e75138 # ########## @@ -56,7 +56,7 @@ else ############## # a service Message was recieved # add your own stuff here - if [[ "${SERVICE}" != "" ]]; then + if [ -n "${SERVICE}" ]; then # example: delete every service message if [ "${SILENCER}" = "yes" ]; then diff --git a/re* b/re* deleted file mode 100644 index e69de29..0000000