From 0b27870479d9c52309d4f03ffb2d2a67d0fe1931 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Mon, 15 Apr 2019 17:44:04 +0200 Subject: [PATCH] some minor doc update --- README.md | 13 +++++++------ doc/1_firstbot.md | 2 +- doc/2_usage.md | 4 ++-- doc/3_advanced.md | 6 +++--- doc/4_expert.md | 2 +- doc/5_practice.md | 2 +- doc/6_reference.md | 2 +- 7 files changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 58a6fbb..9f01fa8 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/doc/1_firstbot.md b/doc/1_firstbot.md index 05b1cca..5ebb490 100644 --- a/doc/1_firstbot.md +++ b/doc/1_firstbot.md @@ -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 diff --git a/doc/2_usage.md b/doc/2_usage.md index 8f4f1da..3415480 100644 --- a/doc/2_usage.md +++ b/doc/2_usage.md @@ -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 diff --git a/doc/3_advanced.md b/doc/3_advanced.md index c4b1f56..59be5fe 100644 --- a/doc/3_advanced.md +++ b/doc/3_advanced.md @@ -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 diff --git a/doc/4_expert.md b/doc/4_expert.md index 5ca2782..b9f32e2 100644 --- a/doc/4_expert.md +++ b/doc/4_expert.md @@ -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 diff --git a/doc/5_practice.md b/doc/5_practice.md index 0ede099..6bdc2f9 100644 --- a/doc/5_practice.md +++ b/doc/5_practice.md @@ -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 diff --git a/doc/6_reference.md b/doc/6_reference.md index c68fe6f..8e122ef 100644 --- a/doc/6_reference.md +++ b/doc/6_reference.md @@ -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