some minor doc update

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2019-04-15 17:44:04 +02:00
parent ba80ec6976
commit 0b27870479
7 changed files with 16 additions and 15 deletions

View File

@ -50,14 +50,15 @@ git clone --recursive https://github.com/topkecleon/telegram-bot-bash
- Customizing commands.sh
- Seperate Bot logic from command
- Test your Bot with shellcheck
- [Bashbot functions reference](doc/6_reference.md)
## Note to Keyboards
To make using Keayboards easier I changed the format of send_keyboard as of send_message "mykeyboardstartshere ...".
Now you must provide the keyboards in Telegram JSON style "[ \"yes\" , \"no\" ]".
The advantage is that you can create every type of keyboard iwithout relying on bashbot ```send_keyboard``` functionality.
## Note on Keyboards
To make use of Keyboards easyer we changed the format of ```send_keyboard``` and ```send_message "mykeyboardstartshere ..."```.
Now you must provide the keyboards in Telegram JSON Array style "[ \"yes\" , \"no\" ]".
The advantage is that you can create every type of keyboard without relying on bashbot ```send_keyboard``` functionality.
**This is incompatible with keyboards in bashbot versions older than 0.6!**
*Example Keboards*:
*Example Keyboards*:
- Yes No in one row: "[ \"yes\" , \"no\" ]"
- Yes No ind two rows: "[ \"yes\" ] , [ \"no\" ]"
@ -91,4 +92,4 @@ No - its not less (in)secure as any other Bot written in any other language. But
If you feel that there's something missing or if you found a bug, feel free to submit a pull request!
#### $$VERSION$$ v0.6-rc1-7-g14eb352
#### $$VERSION$$ v0.6-rc1-11-gba80ec6

View File

@ -70,5 +70,5 @@ git clone --recursive https://github.com/topkecleon/telegram-bot-bash
```
3. Change to directory ```telegram-bot.bash```, run ```./bashbot.sh init``` and follow the instructions. At this stage you are asked for your Bots token given by botfather.
#### $$VERSION$$ v0.6-rc1-7-g14eb352
#### $$VERSION$$ v0.6-rc1-11-gba80ec6

View File

@ -138,7 +138,7 @@ send_file "${CHAT[ID]}" "/home/user/doge.jpg" "Lool"
```
To send custom keyboards use the ```send_keyboard``` function:
```bash
send_keyboard "${CHAT[ID]}" "Text that will appear in chat?" "Yep" "No"
send_keyboard "${CHAT[ID]}" "Text that will appear in chat?" "[ \"Yep\" , \"No\" ]"
```
To send locations use the ```send_location``` function:
```bash
@ -154,6 +154,6 @@ Allowed values: typing for text messages, upload_photo for photos, record_video
send_action "${CHAT[ID]}" "action"
```
#### $$VERSION$$ v0.6-rc1-7-g14eb352
#### $$VERSION$$ v0.6-rc1-11-gba80ec6

View File

@ -61,7 +61,7 @@ To create interactive chats, write (or edit the question script) a normal bash (
The text that the script will output will be sent in real time to the user, and all user input will be sent to the script (as long as it's running or until the user kills it with /cancel).
To open up a keyboard in an interactive script, print out the keyboard layout in the following way:
```bash
echo "Text that will appear in chat? mykeyboardstartshere \"Yep, sure\" \"No, highly unlikely\""
echo "Text that will appear in chat? mykeyboardstartshere [ \"Yep, sure\" , \"No, highly unlikely\" ]"
```
Same goes for files:
```bash
@ -77,7 +77,7 @@ echo "Text that will appear in chat. mylatstartshere 45 mylongstartshere 45 myti
```
You can combine them:
```bash
echo "Text that will appear in chat? mykeyboardstartshere \"Yep, sure\" \"No, highly unlikely\" myfilelocationstartshere /home/user/doge.jpg mylatstartshere 45 mylongstartshere 45"
echo "Text that will appear in chat? mykeyboardstartshere [ \"Yep, sure\" , \"No, highly unlikely\" ] myfilelocationstartshere /home/user/doge.jpg mylatstartshere 45 mylongstartshere 45"
```
Please note that you can either send a location or a venue, not both. To send a venue add the mytitlestartshere and the myaddressstartshere keywords.
@ -153,5 +153,5 @@ To send stickers through an *inline query*:
answer_inline_query "$iQUERY_ID" "cached_sticker" "identifier for the sticker"
```
#### $$VERSION$$ v0.6-rc1-7-g14eb352
#### $$VERSION$$ v0.6-rc1-11-gba80ec6

View File

@ -102,5 +102,5 @@ An example crontab is provided in ```bashbot.cron```.
- if you run bashbot as an other user or a system service edit ```bashbot.cron``` to fit your needs and replace username```nobody``` with the username you want to run bashbot. copy the modified file to ```/etc/cron.d/bashbot```
#### $$VERSION$$ v0.6-rc1-7-g14eb352
#### $$VERSION$$ v0.6-rc1-11-gba80ec6

View File

@ -112,5 +112,5 @@ In bashbot.sh line 490:
Here are two warnings in bashbots scripts. The first is a hint you may use shell substitions instead of sed, this is really possible and much faster!
The second warning is about an unused variable, this is true because in our examples CONTACT is not used but assigned in case you want to use it :-)
#### $$VERSION$$ v0.6-rc1-7-g14eb352
#### $$VERSION$$ v0.6-rc1-11-gba80ec6

View File

@ -199,5 +199,5 @@ The name of your bot is availible as bash variable "$ME", there is no need to ca
##### inproc
Send Input from Telegram to waiting Interactive Chat.
#### $$VERSION$$ v0.6-rc1-7-g14eb352
#### $$VERSION$$ v0.6-rc1-11-gba80ec6