From 3a29a9dc4a44540f831b2d1166209a02944362b0 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Mon, 1 Feb 2021 12:58:57 +0100 Subject: [PATCH] doc: xlink webhook example --- README.html | 3 ++- README.md | 5 +++-- README.txt | 3 ++- bashbot.sh | 4 ++-- doc/6_reference.md | 6 +++--- examples/webhook/README.md | 16 +++++++++------- 6 files changed, 21 insertions(+), 16 deletions(-) diff --git a/README.html b/README.html index 7c61d88..66faa5c 100644 --- a/README.html +++ b/README.html @@ -284,7 +284,8 @@ Written by Drew (@topkecleon) and Kay M (@gnadelwartz).
  • Setup your environment
  • Bashbot test suite
  • -
  • Examples Directory
  • +
  • Examples Directory
  • +
  • Webhook Example
  • Your very first bashbot in a nutshell

    To install and run bashbot you need access to a Linux/Unix command line with bash, a Telegram client and a mobile phone with a Telegram account.

    diff --git a/README.md b/README.md index 0304e4e..c530ef2 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,8 @@ Bashbot [Documentation](https://github.com/topkecleon/telegram-bot-bash) and [Do * Modules, addons, events * Setup your environment * Bashbot test suite -* [Examples Directory](examples/README.md) +* [Examples Directory](examples) +* [Webhook Example](examples/webhook) ### Your very first bashbot in a nutshell @@ -238,4 +239,4 @@ See `mycommnds.sh.dist` for an example. If you feel that there's something missing or if you found a bug, feel free to submit a pull request! -#### $$VERSION$$ v1.32-dev-9-g13052f0 +#### $$VERSION$$ v1.40-dev-29-g737be16 diff --git a/README.txt b/README.txt index 68709b3..0a5498b 100644 --- a/README.txt +++ b/README.txt @@ -112,7 +112,8 @@ Documentation o Setup your environment o Bashbot test suite -* Examples Directory [examples/README.md] +* Examples Directory [examples] +* Webhook Example [examples/webhook] Your very first bashbot in a nutshell diff --git a/bashbot.sh b/bashbot.sh index 108add2..1171b9d 100755 --- a/bashbot.sh +++ b/bashbot.sh @@ -30,7 +30,7 @@ BOTCOMMANDS="-h help init start stop status suspendback resumeback killb # 8 - curl/wget missing # 10 - not bash! # -#### $$VERSION$$ v1.40-dev-27-gc4d100e +#### $$VERSION$$ v1.40-dev-29-g737be16 ################################################################## # are we running in a terminal? @@ -688,7 +688,7 @@ event_send() { # initialize bot environment, user and permissions bot_init() { cd "${BASHBOT_HOME}" || printf "Can't change to BASHBOT_HOME" && exit_source 1 - # load addons on startup + # initialize addons printf "Initialize addons ...\n" for addons in "${ADDONDIR:-.}"/*.sh ; do # shellcheck source=./modules/aliases.sh diff --git a/doc/6_reference.md b/doc/6_reference.md index 52edbf0..ee10b5d 100644 --- a/doc/6_reference.md +++ b/doc/6_reference.md @@ -1227,8 +1227,8 @@ https://linuxconfig.org/how-to-use-arrays-in-bash-script ### Manage webhook Bashbot default mode is to poll Telegram server for updates but Telegram offers also webhook as a more efficient method to deliver updates. -*Important*: Before using webhook you must setup your server to receive and process updates from Telegram! -I recommend to use webhook with a test bot first. [Webhook examples](../examples/webhook) +*Important*: Before enable webhook you must setup your server to [receive and process webhook updates from Telegram](../examples/webhook) +I recommend to use webhook with a test bot first. ##### get_webhook_info `get_webhook_info` get current status of webhook for your bot, e.g. url, waiting updates, last error. @@ -1578,5 +1578,5 @@ The name of your bot is available as bash variable "$ME", there is no need to ca #### [Prev Best Practice](5_practice.md) #### [Next Notes for Developers](7_develop.md) -#### $$VERSION$$ v1.40-dev-17-g8034a5f +#### $$VERSION$$ v1.40-dev-29-g737be16 diff --git a/examples/webhook/README.md b/examples/webhook/README.md index 6945816..badbdce 100644 --- a/examples/webhook/README.md +++ b/examples/webhook/README.md @@ -33,15 +33,17 @@ Now your Apache is ready to forward data to Bashbot. #### Simple update processing -To configure simple update processing delete file `data-bot-bash/webhook-fifo` after your webhook is working. -Every webhook call now forwards incoming Telegram updates to the named pipe `data-bot-bash/webhook-fifo` +To configure `Simple update processing` delete the file `data-bot-bash/webhook-fifo` after your webhook is working. +All webhook calls are now forwarded to `bin/process_update.sh` for processing. -Now enable webhook on Telegram (_see below_). +To start `Simple processing ` enable webhook on Telegram (_see below_). Every incoming Telegram update load Bashbot once for processing one command. Even it seems overkill to load -Bashbot on every update, it's more responsive and create less server load for a low traffic bot. +Bashbot on every incoming update, it's more responsive and create less server load for low traffic bots. -*Note:* You must NOT start bashbot when simple update processing is enabled. +If your bot uses `addons` or `BASHBOT_EVENTs` you can't use `Simple processing`. + +*Note:* `Simple processing` works without running `bashbot.sh start`. #### High traffic processing @@ -51,7 +53,7 @@ Bashbot on every update, it's more responsive and create less server load for a High traffic processing writes Telegram updates to the named pipe `data-bot-bash/webhook-fifo` and Bashbot poll them, this is much more efficient than polling Telegram server. -To switch from `Simple processing` to `High traffic processing` start bashbot as `bashbot.sh start-hook`. +To switch from `Simple processing` to `High traffic processing` start bashbot as `bashbot.sh start-webhook`. Stop bashbot with `bashbot.sh stop` to switch back to `Simple processing` @@ -74,5 +76,5 @@ To stop delivering of Telegram updates via webhook run `bin/any_command.sh delet **Important**: Only https connections with a valid certificate chain are allowed as endpoint for webhook. -#### $$VERSION$$ v1.40-dev-28-g91a143a +#### $$VERSION$$ v1.40-dev-29-g737be16