diff --git a/addons/example.sh b/addons/example.sh index 9c9c15e..559a751 100644 --- a/addons/example.sh +++ b/addons/example.sh @@ -29,7 +29,7 @@ # BASHBOT_EVENT_LOCATION location or venue received # BASHBOT_EVENT_FILE file received # -# BAHSBOT_EVENT_TIMER this event is a bit special as it fires every Minute +# BASHBOT_EVENT_TIMER this event is a bit special as it fires every Minute # and has 3 meanings: oneshot, every time, every X minutes. # # all global variables and functions can be used in registered functions. diff --git a/doc/4_expert.md b/doc/4_expert.md index 9663268..90059b8 100644 --- a/doc/4_expert.md +++ b/doc/4_expert.md @@ -107,8 +107,8 @@ by sourcing it: *usage:* . bashbot.sh source -Before sourcing 'bahsbot.sh' for interactive and script use, you should export and set BASHBOT_HOME to bashbots installation dir, -e.g. '/usr/local/telegram-bot-bash'. see [Bashbot Environemt](#Bashbot-environment) +Before sourcing 'bashbot.sh' for interactive and script use, you should export and set BASHBOT_HOME to bashbots installation dir, +e.g. '/usr/local/telegram-bot-bash'. see [Bashbot Environment](#Bashbot-environment) **Note:** *If you don't set BASHBOT_HOME bashbot will use the actual directory as NEW home directory which means it will create all needed files and ask for bot token and botadmin if you are not in the real bot home!* diff --git a/doc/5_practice.md b/doc/5_practice.md index d6c897f..f0e3c5d 100644 --- a/doc/5_practice.md +++ b/doc/5_practice.md @@ -15,7 +15,7 @@ To start with a clean/minimal bot copy ```mycommands.sh.clean``` to ```mycommand the message strings and place commands in the```case ... esac``` block of the function mycommands(): ```bash # file: mycommands.sh -# your additional bahsbot commands +# your additional bashbot commands # uncomment the following lines to overwrite info and help messages bashbot_info='This is *MY* variant of _bashbot_, the Telegram bot written entirely in bash. diff --git a/doc/6_reference.md b/doc/6_reference.md index efee20a..add13f7 100644 --- a/doc/6_reference.md +++ b/doc/6_reference.md @@ -281,7 +281,7 @@ fi *See also [Chat Member](https://core.telegram.org/bots/api/#chatmember)* ##### user_is_allowed -Bahsbot supports User Access Control, see [Advanced Usage](3_advanced.md) +Bashbot supports User Access Control, see [Advanced Usage](3_advanced.md) *usage:* user_is_allowed "${USER[ID]}" "what" "${CHAT[ID]}" diff --git a/doc/7_develop.md b/doc/7_develop.md index 25b4238..8291d2a 100644 --- a/doc/7_develop.md +++ b/doc/7_develop.md @@ -31,7 +31,7 @@ you can the change the level of verbosity of the debug argument: to keep 'bashbot.sh' small, while extending functionality. In addition not every function is needed by all bots, so you can disable modules, e.g. by rename the respective module file to 'module.sh.off'. -Modules must use only functions provided by 'bahsbot.sh' or the module itself and should not depend on other modules or addons. +Modules must use only functions provided by 'bashbot.sh' or the module itself and should not depend on other modules or addons. The only mandatory module is 'module/sendMessage.sh'. If a not mandatory module is used in 'bashbot.sh' or 'commands.sh', the use of ```_is_function``` or @@ -115,7 +115,7 @@ To avoid wrong use of EVENT_SEND, e.g. fork bomb, event processing is suspended *Example:* ```bash # register callback: -BAHSBOT_EVENT_SEND["example_log","1"]="example_log" +BASHBOT_EVENT_SEND["example_log","1"]="example_log" EXAMPLE_LOG="${BASHBOT_ETC:-.}/addons/${EXAMPLE_ME}.log" # Note: do not call any send message functions from EVENT_SEND! @@ -130,7 +130,7 @@ example_log(){ Important: Bashbot timer tick is disabled by default and must be enabled by setting BASHBOT_START_TIMER to any value not zero. -* BAHSBOT_EVENT_TIMER executed every minute and can be used in 3 variants: oneshot, once a minute, every X minutes. +* BASHBOT_EVENT_TIMER executed every minute and can be used in 3 variants: oneshot, once a minute, every X minutes. Registering to BASHBOT_EVENT_TIMER works similar as for message events, but you must add a timing argument to the name. EVENT_TIMER is triggered every 60s and waits until the current running command is finished, so it's not exactly every @@ -139,7 +139,7 @@ minute, but once a minute. Every time EVENT_TIMER is triggered the variable "EVENT_TIMER" is increased. each callback is executed if ```EVENT_TIMER % time``` is '0' (true). This means if you register an every 5 minutes callback first execution may < 5 Minutes, all subsequent executions are once every 5. Minute. -*usage:* BAHSBOT_EVENT_TIMER[ "name" , "time" ], where time is: +*usage:* BASHBOT_EVENT_TIMER[ "name" , "time" ], where time is: * 0 ignored * 1 execute once every minute @@ -151,7 +151,7 @@ Note: If you want exact "in x minutes" use "EVENT_TIMER plus x" as time: ```-(EV *Example:* ```bash # register callback: -BAHSBOT_EVENT_TIMER["example_every","1"]="example_everymin" +BASHBOT_EVENT_TIMER["example_every","1"]="example_everymin" # function called every minute example_everymin() { @@ -160,13 +160,13 @@ example_everymin() { } # register other callback: -BAHSBOT_EVENT_TIMER["example_every5","5"]="example_every5min" +BASHBOT_EVENT_TIMER["example_every5","5"]="example_every5min" # execute once on the next 10 minutes since start "event" -BAHSBOT_EVENT_TIMER["example_10min","-10"]="example_in10min" +BASHBOT_EVENT_TIMER["example_10min","-10"]="example_in10min" # once in exact 10 minutes -BAHSBOT_EVENT_TIMER["example_10min","$(( (EVENT_TIMER+10) * -1 ))"]="example_in10min" +BASHBOT_EVENT_TIMER["example_10min","$(( (EVENT_TIMER+10) * -1 ))"]="example_in10min" ``` @@ -297,7 +297,7 @@ To create a new test run ```test/ADD-test-new.sh``` and answer the questions, it Each test consists of a script script named after ```p-name-test.sh``` *(where p is test pass 'a-z' and name the name of your test)* and an optional dir ```p-name-test/``` *(script name minus '.sh')* for additional files. -Tests with no dependency to other tests will run in pass 'a', tests which need an initialized bahsbot environment must run in pass 'd' or later. +Tests with no dependency to other tests will run in pass 'a', tests which need an initialized bashbot environment must run in pass 'd' or later. A temporary test environment is created when 'ALL-tests.sh' starts and deleted after all tests are finished. The file ```ALL-tests.inc.sh``` must be included from all tests and provide the test environment as shell variables: diff --git a/examples/background-scripts/mycommands.sh b/examples/background-scripts/mycommands.sh index 3084fae..9a813e4 100644 --- a/examples/background-scripts/mycommands.sh +++ b/examples/background-scripts/mycommands.sh @@ -3,7 +3,7 @@ # copy to mycommands.sh and add all your commands an functions here ... export res -# your additional bahsbot commands ... +# your additional bashbot commands ... mycommands() { case "$MESSAGE" in diff --git a/examples/bashbot-multi.sh b/examples/bashbot-multi.sh index db0eb03..122db50 100755 --- a/examples/bashbot-multi.sh +++ b/examples/bashbot-multi.sh @@ -23,8 +23,8 @@ if true; then else # alternative linux like locations BINDIR="/usr/local/bin" - ETC="/etc/bahsbot" - VAR="/var/bahsbot" + ETC="/etc/bashbot" + VAR="/var/bashbot" export BASHBOT_JSONSH="/usr/local/bin/JSON.sh" fi diff --git a/examples/jsonDB-keyboard/mycommands.sh b/examples/jsonDB-keyboard/mycommands.sh index bd2b081..3dec529 100644 --- a/examples/jsonDB-keyboard/mycommands.sh +++ b/examples/jsonDB-keyboard/mycommands.sh @@ -206,7 +206,7 @@ else my_startup fi - # your additional bahsbot commands + # your additional bashbot commands # NOTE: command can have @botname attached, you must add * in case tests... mycommands() { # a service Message was received diff --git a/examples/send-system-status/mycommands.sh b/examples/send-system-status/mycommands.sh index 349a7b6..dcf7fee 100644 --- a/examples/send-system-status/mycommands.sh +++ b/examples/send-system-status/mycommands.sh @@ -32,7 +32,7 @@ bashbot_help='*Available commands*: ' -# your additional bahsbot commands +# your additional bashbot commands # NOTE: command can have @botname attached, you must add * in case tests... mycommands() { local msg=""