update doc, prepare for release

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2020-05-14 15:47:04 +02:00
parent ac2ec02a98
commit 4aa7561f7c
17 changed files with 57 additions and 45 deletions

View File

@ -223,6 +223,6 @@ It features background tasks and interactive chats, and can serve as an interfac
<p>@Gnadelwartz</p> <p>@Gnadelwartz</p>
<h2>That's it!</h2> <h2>That's it!</h2>
<p>If you feel that there's something missing or if you found a bug, feel free to submit a pull request!</p> <p>If you feel that there's something missing or if you found a bug, feel free to submit a pull request!</p>
<h4>$$VERSION$$ v0.94-dev3-0-geef955a</h4> <h4>$$VERSION$$ v0.94-pre-0-gac2ec02</h4>
</body> </body>
</html> </html>

View File

@ -180,4 +180,4 @@ This may happen if to many wrong requests are sent to api.telegram.org, e.g. usi
If you feel that there's something missing or if you found a bug, feel free to submit a pull request! If you feel that there's something missing or if you found a bug, feel free to submit a pull request!
#### $$VERSION$$ v0.94-dev3-0-geef955a #### $$VERSION$$ v0.94-pre-0-gac2ec02

View File

@ -253,4 +253,4 @@ tor proxy on your server you may uncomment the ```BASHBOT_CURL_ARGS``` line in
If you feel that there's something missing or if you found a bug, feel free to If you feel that there's something missing or if you found a bug, feel free to
submit a pull request! submit a pull request!
#### $$VERSION$$ v0.94-dev3-0-geef955a #### $$VERSION$$ v0.94-pre-0-gac2ec02

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# description: Start or stop telegram-bash-bot # description: Start or stop telegram-bash-bot
# #
#### $$VERSION$$ v0.94-dev3-0-geef955a #### $$VERSION$$ v0.94-pre-0-gac2ec02
# shellcheck disable=SC2009 # shellcheck disable=SC2009
# shellcheck disable=SC2181 # shellcheck disable=SC2181

View File

@ -11,7 +11,7 @@
# This file is public domain in the USA and all free countries. # This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
# #
#### $$VERSION$$ v0.94-dev3-3-ga5975d9 #### $$VERSION$$ v0.94-pre-0-gac2ec02
# #
# Exit Codes: # Exit Codes:
# - 0 sucess (hopefully) # - 0 sucess (hopefully)

View File

@ -15,7 +15,7 @@
# This file is public domain in the USA and all free countries. # This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
# #
#### $$VERSION$$ v0.94-dev3-2-gbf8a911 #### $$VERSION$$ v0.94-pre-0-gac2ec02
# #
# adjust your language setting here, e.g.when run from other user or cron. # adjust your language setting here, e.g.when run from other user or cron.

View File

@ -87,5 +87,5 @@ The old format is supported for backward compatibility, but may fail for corner
#### [Next Create Bot](1_firstbot.md) #### [Next Create Bot](1_firstbot.md)
#### $$VERSION$$ v0.94-dev3-0-geef955a #### $$VERSION$$ v0.94-pre-0-gac2ec02

View File

@ -65,5 +65,5 @@ group. This step is up to you actually.
#### [Prev Installation](0_install.md) #### [Prev Installation](0_install.md)
#### [Next Getting started](2_usage.md) #### [Next Getting started](2_usage.md)
#### $$VERSION$$ v0.94-dev3-0-geef955a #### $$VERSION$$ v0.94-pre-0-gac2ec02

View File

@ -17,9 +17,13 @@ Have FUN!
### Files ### Files
``` ```
. .
├── bashbot.sh # main bashbot script - do not edit ├── mycommands.sh # THIS is your bot, place logic and commands here!
├── commands.sh # command dispatcher - do not edit
├── mycommands.sh # place your functions and commands here! ├── mycommands.sh.clean # copy to "mycommands.sh" if you start devloping your bot
├── mycommands.sh.dist # example bot, also used for testing bashbot internally
├── bashbot.sh # main bashbot script - DO NOT EDIT!
├── commands.sh # command dispatcher - DO NOT EDIT!
├── JSON.sh # bashbots JSON parser, see https://github.com/dominictarr/JSON.sh ├── JSON.sh # bashbots JSON parser, see https://github.com/dominictarr/JSON.sh
├── modules # optional functions, sourced by commands.sh ├── modules # optional functions, sourced by commands.sh
@ -65,16 +69,13 @@ Start or Stop your Bot use the following commands:
``` ```
### User count ### User count
To count the total number of users that ever used the bot run the following command:
```bash deprecated, will be removed!
./bashbot.sh count
``` ```
### Sending broadcasts to all users ### Sending broadcasts to all users
To send a broadcast to all of users that ever used the bot run the following command:
```bash
./bashbot.sh broadcast "Hey! I just wanted to let you know that the bot's been updated!"
``` ```
deprecated, will be removed!
---- ----
@ -134,6 +135,22 @@ Evertime a Message is recieved, you can read incoming data using the following v
* ```${VENUE[LONGITUDE]}```: Longitude * ```${VENUE[LONGITUDE]}```: Longitude
* ```${VENUE[LATITUDE]}```: Latitude * ```${VENUE[LATITUDE]}```: Latitude
* ```${VENUE[FOURSQUARE]}```: Fouresquare ID * ```${VENUE[FOURSQUARE]}```: Fouresquare ID
* ```$SERVICE```: This array contains info abbout recived service messages.
* ```${SERVICE}```: set to "yes" when a service message is recived.
* ```${SERVICE[NEWMEMBER]```: New user's id
* ```${NEWMEMBER[ID]```: New user's id
* ```${NEWMEMBER[FIRSTNAME]```: New user's first name
* ```${NEWMEMBER[LASTNAME]```: New user's last name
* ```${NEWMEMBER[USERNAME]```: New user's username
* ```${NEWMEMBER[ISBOT]```: New user is a bot
* ```${SERVICE[LEFTMEMBER]```: Id of user left
* ```${SERVICE[NEWTILE]```: Text of new title
* ```${SERVICE[NEWPHOTO]```: New Chat Picture array
* ```${SERVICE[PINNED]```: Pinned Message structure
### Inline queries ### Inline queries
Evertime a Message is recieved, you can read incoming data using the following variables: Evertime a Message is recieved, you can read incoming data using the following variables:
@ -223,5 +240,5 @@ send_action "${CHAT[ID]}" "action"
#### [Prev Create Bot](1_firstbot.md) #### [Prev Create Bot](1_firstbot.md)
#### [Next Advanced Usage](3_advanced.md) #### [Next Advanced Usage](3_advanced.md)
#### $$VERSION$$ v0.94-dev3-0-geef955a #### $$VERSION$$ v0.94-pre-0-gac2ec02

View File

@ -180,5 +180,5 @@ See also [answer_inline_multi, answer_inline_compose](6_reference.md#answer_inli
#### [Prev Getting started](2_usage.md) #### [Prev Getting started](2_usage.md)
#### [Next Expert Use](4_expert.md) #### [Next Expert Use](4_expert.md)
#### $$VERSION$$ v0.94-dev3-0-geef955a #### $$VERSION$$ v0.94-pre-0-gac2ec02

View File

@ -348,5 +348,5 @@ for every poll until the maximum of BASHBOT_SLEEP ms.
#### [Prev Advanced Use](3_advanced.md) #### [Prev Advanced Use](3_advanced.md)
#### [Next Best Practice](5_practice.md) #### [Next Best Practice](5_practice.md)
#### $$VERSION$$ v0.94-dev3-0-geef955a #### $$VERSION$$ v0.94-pre-0-gac2ec02

View File

@ -152,5 +152,5 @@ The second warning is about an unused variable, this is true because in our exam
#### [Prev Best Practice](5_practice.md) #### [Prev Best Practice](5_practice.md)
#### [Next Functions Reference](6_reference.md) #### [Next Functions Reference](6_reference.md)
#### $$VERSION$$ v0.94-dev3-0-geef955a #### $$VERSION$$ v0.94-pre-0-gac2ec02

View File

@ -506,19 +506,6 @@ Something wrong with /home/someuser/myfile
Something wrong with data-bot-bash/../../../somevalues Something wrong with data-bot-bash/../../../somevalues
``` ```
##### jssh_readDB
Read content of a .jssh file in JSON.sh format into given ARRAY. ARRAY name must be delared with "declare -A ARRAY" before calling readDB.
*usage:* jssh_readDB "ARRAY" "filename"
*example:*
```bash
# read file data-bot-bash/somevalues.jssh into array SOMEVALUES
jssh_readDB "SOMEVALUES" "${DATADIR:-.}/somevalues"
print "${SOMEVALUES[*]}"
```
##### jssh_writeDB ##### jssh_writeDB
Write content of an ARRAY into jsshDB file. ARRAY name must be delared with "declare -A ARRAY" before calling writeDB. Write content of an ARRAY into jsshDB file. ARRAY name must be delared with "declare -A ARRAY" before calling writeDB.
"DB" file MUST exist or nothing is written. "DB" file MUST exist or nothing is written.
@ -610,8 +597,6 @@ echo "$result"
this is new this is new
``` ```
----
##### jssh_readDB ##### jssh_readDB
Read content of a file in JSON.sh format into given ARRAY. ARRAY name must be delared with "declare -A ARRAY" upfront, Read content of a file in JSON.sh format into given ARRAY. ARRAY name must be delared with "declare -A ARRAY" upfront,
@ -662,10 +647,13 @@ whynot,subindex3=new subindex value
whynot,subindex2=whynot B whynot,subindex2=whynot B
whynot,subindex1=whynot A whynot,subindex1=whynot A
``` ```
https://linuxhint.com/associative_array_bash/ https://linuxhint.com/associative_array_bash/
https://linuxconfig.org/how-to-use-arrays-in-bash-script https://linuxconfig.org/how-to-use-arrays-in-bash-script
----
### Aliases - shortcuts for often used funtions ### Aliases - shortcuts for often used funtions
Aliases are handy shortcuts for using in 'mycommands.sh', they avoid error prone typing of "${CHAT[ID]}" "${USER[ID]}" as much as possible. Aliases are handy shortcuts for using in 'mycommands.sh', they avoid error prone typing of "${CHAT[ID]}" "${USER[ID]}" as much as possible.
Do not use them in bashbot.sh, modules and addons. Do not use them in bashbot.sh, modules and addons.
@ -947,5 +935,5 @@ The name of your bot is availible as bash variable "$ME", there is no need to ca
#### [Prev Best Practice](5_practice.md) #### [Prev Best Practice](5_practice.md)
#### [Next Notes for Developers](7_develop.md) #### [Next Notes for Developers](7_develop.md)
#### $$VERSION$$ v0.94-dev3-0-geef955a #### $$VERSION$$ v0.94-pre-0-gac2ec02

View File

@ -7,17 +7,24 @@ If you want to provide fixes or new features [fork bashbot on githup](https://he
### Debugging Bashbot ### Debugging Bashbot
Usually all bashbot output is discarded. Usually all bashbot output is discarded.
If you want to get error messages (and more) start bashbot in the current shell with ```./bashbot.sh startbot```. If you want to get error messages (and more) start bashbot ```./bashbot.sh startbot debug```.
In addition you can the change the level of verbosity by adding a 'debug' as third argument. you can the change the level of verbosity of the debug argument:
``` ```
"debug" all output is redirected to "DEBUG.log", in addtion every incomming message is logged in "MESSAGE.log" and "INLINE.log"
"xdebug" same as debug plus set bash option '-x' to log any executed command in "DEBUG.log"
use the command tail to watch your bot live, e.g. "tail -f DEBUG.log", to obtain more information place set -x; set +x in your code.
```
```
sometimes its useful to watch the bot live in the terminal:
"debugx" debug output and errors are sent to terminal "debugx" debug output and errors are sent to terminal
"xdebugx" same as debugx plus set bash option '-x' to show any executed command "xdebugx" same as debugx plus set bash option '-x' to show any executed command
"debug" all output is redirected to "DEBUG.log", in addtion every incomming message is logged in "MESSAGE.LOG" and "INLINE.log"
"xdebug" same as debug plus set bash option '-x' to log any executed command in "DEBUG.log"
``` ```
To stop bashhbot in debugging mode press CRTL+C. If this does not stop bashbot or you run it in background execute ```ps -uf | grep debug``` and kill all shown processes.
### Modules and Addons ### Modules and Addons
**Modules** resides in ```modules/*.sh``` and are colletions of optional bashbot functions grouped by functionality. Main reason for creating modules was **Modules** resides in ```modules/*.sh``` and are colletions of optional bashbot functions grouped by functionality. Main reason for creating modules was
@ -321,5 +328,5 @@ fi
#### [Prev Function Reference](6_reference.md) #### [Prev Function Reference](6_reference.md)
#### $$VERSION$$ v0.94-dev3-0-geef955a #### $$VERSION$$ v0.94-pre-0-gac2ec02

View File

@ -8,7 +8,7 @@
# #### if you start to develop your own bot, use the clean version of this file: # #### if you start to develop your own bot, use the clean version of this file:
# #### mycommands.clean # #### mycommands.clean
# #
#### $$VERSION$$ v0.94-dev3-3-ga5975d9 #### $$VERSION$$ v0.94-pre-0-gac2ec02
# #
# uncomment the following lines to overwrite info and help messages # uncomment the following lines to overwrite info and help messages

View File

@ -4,7 +4,7 @@
# files: mycommands.sh.clean # files: mycommands.sh.clean
# copy to mycommands.sh and add all your commands and functions here ... # copy to mycommands.sh and add all your commands and functions here ...
# #
#### $$VERSION$$ v0.94-dev3-3-ga5975d9 #### $$VERSION$$ v0.94-pre-0-gac2ec02
# #
########## ##########

0
re* Normal file
View File