From 25a33b37310913610d3f7498310eb71d21a3c827 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Sat, 15 Aug 2020 09:29:13 +0200 Subject: [PATCH] Bashbot Version 1.0 --- README.html | 2 +- README.md | 2 +- README.txt | 2 +- addons/antiFlood.sh | 2 +- addons/example.sh | 2 +- bashbot.rc | 2 +- bashbot.sh | 2 +- commands.sh | 2 +- dev/all-tests.sh | 2 +- dev/git-add.sh | 2 +- dev/hooks/pre-commit.sh | 2 +- dev/hooks/pre-push.sh | 2 +- dev/install-hooks.sh | 2 +- dev/make-distribution.sh | 2 +- dev/make-standalone.sh | 2 +- dev/shellcheck.files | 2 +- dev/version.sh | 2 +- doc/0_install.md | 2 +- doc/1_firstbot.md | 2 +- doc/2_usage.md | 2 +- doc/3_advanced.md | 2 +- doc/4_expert.md | 2 +- doc/5_practice.md | 2 +- doc/6_reference.md | 2 +- doc/7_develop.md | 2 +- examples/README.md | 2 +- examples/background-scripts/run_diskusage.sh | 2 +- .../background-scripts/run_filecontent.sh | 2 +- examples/background-scripts/run_filename.sh | 2 +- examples/background-scripts/run_notify.sh | 2 +- examples/bash2env.sh | 2 +- examples/bashbot-multi.sh | 2 +- examples/bashbot.cron | 2 +- examples/calc.sh | 2 +- examples/jsonDB-keyboard/mycommands.sh | 2 +- examples/notify.sh | 2 +- examples/question.sh | 2 +- examples/send-system-status/botacl | 2 +- examples/send-system-status/mycommands.sh | 2 +- modules/aliases.sh | 2 +- modules/answerInline.sh | 2 +- modules/background.sh | 2 +- modules/chatMember.sh | 2 +- modules/jsonDB.sh | 2 +- modules/sendMessage.sh | 2 +- mycommands.sh | 25 ++++++++++--------- mycommands.sh.clean | 2 +- scripts/interactive.sh.clean | 2 +- test/ADD-test-new.sh | 2 +- test/ALL-tests.inc.sh | 2 +- test/a-commit-test.sh | 2 +- test/b-example-test.sh | 2 +- test/c-init-test.sh | 2 +- test/d-JSON.sh-test.sh | 2 +- test/d-process_inline-test.sh | 2 +- test/d-process_message-test.sh | 2 +- test/d-send_message-test.sh | 2 +- test/d-user_is-test.sh | 2 +- test/e-env-test.sh | 2 +- 59 files changed, 71 insertions(+), 70 deletions(-) diff --git a/README.html b/README.html index 80fe75e..8665698 100644 --- a/README.html +++ b/README.html @@ -269,6 +269,6 @@ It features background tasks and interactive chats, and can serve as an interfac

@Gnadelwartz

That's it!

If you feel that there's something missing or if you found a bug, feel free to submit a pull request!

-

$$VERSION$$ 0.99-2-gacf9d84

+

$$VERSION$$ v1.0-0-g99217c4

diff --git a/README.md b/README.md index fdf91f2..397d9af 100644 --- a/README.md +++ b/README.md @@ -261,4 +261,4 @@ bashbotBlockRecover() { If you feel that there's something missing or if you found a bug, feel free to submit a pull request! -#### $$VERSION$$ 0.99-2-gacf9d84 +#### $$VERSION$$ v1.0-0-g99217c4 diff --git a/README.txt b/README.txt index c4c1bb2..24283eb 100644 --- a/README.txt +++ b/README.txt @@ -351,4 +351,4 @@ wait If you feel that there's something missing or if you found a bug, feel free to submit a pull request! -#### $$VERSION$$ 0.99-2-gacf9d84 +#### $$VERSION$$ v1.0-0-g99217c4 diff --git a/addons/antiFlood.sh b/addons/antiFlood.sh index ea85748..d3f0696 100644 --- a/addons/antiFlood.sh +++ b/addons/antiFlood.sh @@ -4,7 +4,7 @@ # this addon counts how many files, e.g. stickers, are sent to # a chat and takes actions if threshold is reached # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # used events: # diff --git a/addons/example.sh b/addons/example.sh index b28fb83..9c9c15e 100644 --- a/addons/example.sh +++ b/addons/example.sh @@ -4,7 +4,7 @@ # Addons can register to bashbot events at startup # by providing their name and a callback per event # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # # If an event occurs each registered event function is called. # diff --git a/bashbot.rc b/bashbot.rc index 0bfb8dc..e5b1a43 100755 --- a/bashbot.rc +++ b/bashbot.rc @@ -1,7 +1,7 @@ #!/bin/sh # description: Start or stop telegram-bash-bot # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # shellcheck disable=SC2009 # shellcheck disable=SC2181 diff --git a/bashbot.sh b/bashbot.sh index e743697..7885ae3 100755 --- a/bashbot.sh +++ b/bashbot.sh @@ -11,7 +11,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ 0.99-10-gb9c8dc0 +#### $$VERSION$$ v1.0-0-g99217c4 # # Exit Codes: # - 0 success (hopefully) diff --git a/commands.sh b/commands.sh index 907f576..9950fbe 100644 --- a/commands.sh +++ b/commands.sh @@ -15,7 +15,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ 0.99-5-gaec7345 +#### $$VERSION$$ v1.0-0-g99217c4 # # adjust your language setting here, e.g.when run from other user or cron. diff --git a/dev/all-tests.sh b/dev/all-tests.sh index 509b3b6..e235953 100755 --- a/dev/all-tests.sh +++ b/dev/all-tests.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # this has to run once atfer git clone # and every time we create new hooks -#### $$VERSION$$ 0.99-8-g6011444 +#### $$VERSION$$ v1.0-0-g99217c4 # magic to ensure that we're always inside the root of our application, # no matter from which directory we'll run script diff --git a/dev/git-add.sh b/dev/git-add.sh index 319e5e9..2cc1a2c 100755 --- a/dev/git-add.sh +++ b/dev/git-add.sh @@ -3,7 +3,7 @@ # # works together with git pre-push.sh and ADD all changed files since last push -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # magic to ensure that we're always inside the root of our application, # no matter from which directory we'll run script diff --git a/dev/hooks/pre-commit.sh b/dev/hooks/pre-commit.sh index fcef4c8..f9da3f3 100755 --- a/dev/hooks/pre-commit.sh +++ b/dev/hooks/pre-commit.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.99-13-g6a6410e +#### $$VERSION$$ v1.0-0-g99217c4 ############ # NOTE: you MUST run install-hooks.sh again when updating this file! diff --git a/dev/hooks/pre-push.sh b/dev/hooks/pre-push.sh index 1ddddf1..54c04aa 100755 --- a/dev/hooks/pre-push.sh +++ b/dev/hooks/pre-push.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 ############ # NOTE: you MUST run install-hooks.sh again when updating this file! diff --git a/dev/install-hooks.sh b/dev/install-hooks.sh index fb3e4d6..16aae7e 100755 --- a/dev/install-hooks.sh +++ b/dev/install-hooks.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # this has to run once atfer git clone # and every time we create new hooks -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # magic to ensure that we're always inside the root of our application, # no matter from which directory we'll run script diff --git a/dev/make-distribution.sh b/dev/make-distribution.sh index 1ffd5bd..288b7cd 100755 --- a/dev/make-distribution.sh +++ b/dev/make-distribution.sh @@ -2,7 +2,7 @@ # file: make-distribution.sh # creates files and arcchives to dirtribute bashbot # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # magic to ensure that we're always inside the root of our application, # no matter from which directory we'll run script diff --git a/dev/make-standalone.sh b/dev/make-standalone.sh index 5cc980d..f27784e 100755 --- a/dev/make-standalone.sh +++ b/dev/make-standalone.sh @@ -5,7 +5,7 @@ # If you your bot is finished you can use make-standalone.sh to create the # the old all-in-one bashbot: bashbot.sh and commands.sh only! # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # magic to ensure that we're always inside the root of our application, # no matter from which directory we'll run script diff --git a/dev/shellcheck.files b/dev/shellcheck.files index f5b76f5..7eddbef 100644 --- a/dev/shellcheck.files +++ b/dev/shellcheck.files @@ -1,4 +1,4 @@ # list of additional files to check from shellcheck -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 bashbot.rc mycommands.sh.clean diff --git a/dev/version.sh b/dev/version.sh index 997178f..9ebc67f 100755 --- a/dev/version.sh +++ b/dev/version.sh @@ -1,6 +1,6 @@ #!/bin/bash # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # shellcheck disable=SC2016 # # Easy Versioning in git: diff --git a/doc/0_install.md b/doc/0_install.md index 794fc4b..72b3399 100644 --- a/doc/0_install.md +++ b/doc/0_install.md @@ -131,5 +131,5 @@ The old format is supported for backward compatibility, but may fail for corner #### [Next Create Bot](1_firstbot.md) -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 diff --git a/doc/1_firstbot.md b/doc/1_firstbot.md index d788a50..2ab8bce 100644 --- a/doc/1_firstbot.md +++ b/doc/1_firstbot.md @@ -65,5 +65,5 @@ group. This step is up to you actually. #### [Prev Installation](0_install.md) #### [Next Getting started](2_usage.md) -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 diff --git a/doc/2_usage.md b/doc/2_usage.md index 2fac4b9..af37b8c 100644 --- a/doc/2_usage.md +++ b/doc/2_usage.md @@ -283,5 +283,5 @@ send_action "${CHAT[ID]}" "action" #### [Prev Create Bot](1_firstbot.md) #### [Next Advanced Usage](3_advanced.md) -#### $$VERSION$$ 0.99-1-g3daf84d +#### $$VERSION$$ v1.0-0-g99217c4 diff --git a/doc/3_advanced.md b/doc/3_advanced.md index 09fe4ac..141138b 100644 --- a/doc/3_advanced.md +++ b/doc/3_advanced.md @@ -288,5 +288,5 @@ Note: If you disable automatic retry, se above, you disable also connection prob #### [Prev Getting started](2_usage.md) #### [Next Expert Use](4_expert.md) -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 diff --git a/doc/4_expert.md b/doc/4_expert.md index 96359be..9663268 100644 --- a/doc/4_expert.md +++ b/doc/4_expert.md @@ -378,5 +378,5 @@ for every poll until the maximum of BASHBOT_SLEEP ms. #### [Prev Advanced Use](3_advanced.md) #### [Next Best Practice](5_practice.md) -#### $$VERSION$$ 0.99-1-g3daf84d +#### $$VERSION$$ v1.0-0-g99217c4 diff --git a/doc/5_practice.md b/doc/5_practice.md index 968b328..d6c897f 100644 --- a/doc/5_practice.md +++ b/doc/5_practice.md @@ -158,5 +158,5 @@ The second warning is about an unused variable, this is true because in our exam #### [Prev Best Practice](5_practice.md) #### [Next Functions Reference](6_reference.md) -#### $$VERSION$$ 0.99-1-g3daf84d +#### $$VERSION$$ v1.0-0-g99217c4 diff --git a/doc/6_reference.md b/doc/6_reference.md index 30a54ec..efee20a 100644 --- a/doc/6_reference.md +++ b/doc/6_reference.md @@ -1049,5 +1049,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$$ 0.99-17-g9d7f145 +#### $$VERSION$$ v1.0-0-g99217c4 diff --git a/doc/7_develop.md b/doc/7_develop.md index 0c28296..25b4238 100644 --- a/doc/7_develop.md +++ b/doc/7_develop.md @@ -347,5 +347,5 @@ fi #### [Prev Function Reference](6_reference.md) -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 diff --git a/examples/README.md b/examples/README.md index b9e59e6..eeb8d12 100644 --- a/examples/README.md +++ b/examples/README.md @@ -56,6 +56,6 @@ convert existing bots. **jsonDB-keybords** contains a stripped down real world example from my bot showing the usage of jsonDB to store and retrieve values plus use of keyboards in private chats. It's an extended version of mycommands.sh.dist. Messages and help are in german. -#### $$VERSION$$ 0.99-13-g6a6410e +#### $$VERSION$$ v1.0-0-g99217c4 diff --git a/examples/background-scripts/run_diskusage.sh b/examples/background-scripts/run_diskusage.sh index 77a8f6c..d9e9ff5 100755 --- a/examples/background-scripts/run_diskusage.sh +++ b/examples/background-scripts/run_diskusage.sh @@ -4,7 +4,7 @@ # # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 ###### # parameters diff --git a/examples/background-scripts/run_filecontent.sh b/examples/background-scripts/run_filecontent.sh index a98b10a..e27fc7f 100755 --- a/examples/background-scripts/run_filecontent.sh +++ b/examples/background-scripts/run_filecontent.sh @@ -2,7 +2,7 @@ # file: run_filename # background job to display content of all new files in WATCHDIR # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 ###### # parameters diff --git a/examples/background-scripts/run_filename.sh b/examples/background-scripts/run_filename.sh index 2053dd7..0c9e0fe 100755 --- a/examples/background-scripts/run_filename.sh +++ b/examples/background-scripts/run_filename.sh @@ -2,7 +2,7 @@ # file: run_filename # background job to display all new files in WATCHDIR # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 ###### # parameters diff --git a/examples/background-scripts/run_notify.sh b/examples/background-scripts/run_notify.sh index 16788dd..6460fa0 100755 --- a/examples/background-scripts/run_notify.sh +++ b/examples/background-scripts/run_notify.sh @@ -4,7 +4,7 @@ # # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 ###### # parameters diff --git a/examples/bash2env.sh b/examples/bash2env.sh index 3125262..b2ff238 100755 --- a/examples/bash2env.sh +++ b/examples/bash2env.sh @@ -6,7 +6,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # adjust your language setting here # https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment diff --git a/examples/bashbot-multi.sh b/examples/bashbot-multi.sh index 4ef8292..db0eb03 100755 --- a/examples/bashbot-multi.sh +++ b/examples/bashbot-multi.sh @@ -2,7 +2,7 @@ # file. multibot.sh # description: run multiple telegram bots from one installation # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 if [ "${2}" = "" ] || [ "${2}" = "-h" ]; then echo "Usage: $0 botname command" diff --git a/examples/bashbot.cron b/examples/bashbot.cron index 9c253a1..5d9623f 100644 --- a/examples/bashbot.cron +++ b/examples/bashbot.cron @@ -7,7 +7,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 SHELL=/bin/sh diff --git a/examples/calc.sh b/examples/calc.sh index f9a9104..3102d43 100755 --- a/examples/calc.sh +++ b/examples/calc.sh @@ -5,7 +5,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 ###### # parameters diff --git a/examples/jsonDB-keyboard/mycommands.sh b/examples/jsonDB-keyboard/mycommands.sh index 5bebfdf..bd2b081 100644 --- a/examples/jsonDB-keyboard/mycommands.sh +++ b/examples/jsonDB-keyboard/mycommands.sh @@ -2,7 +2,7 @@ # files: mycommands.sh.dist # copy to mycommands.sh and add all your commands and functions here ... # -#### $$VERSION$$ 0.99-16-gd6de66d +#### $$VERSION$$ v1.0-0-g99217c4 # # shellcheck disable=SC2154 # shellcheck disable=SC2034 diff --git a/examples/notify.sh b/examples/notify.sh index 2d2c9c2..7f2f37a 100755 --- a/examples/notify.sh +++ b/examples/notify.sh @@ -4,7 +4,7 @@ # # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 ###### # parameters diff --git a/examples/question.sh b/examples/question.sh index 4f032b1..9914b31 100755 --- a/examples/question.sh +++ b/examples/question.sh @@ -5,7 +5,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 ###### # parameters diff --git a/examples/send-system-status/botacl b/examples/send-system-status/botacl index a5cec5d..c13a16a 100644 --- a/examples/send-system-status/botacl +++ b/examples/send-system-status/botacl @@ -1,7 +1,7 @@ # file: botacl # a user not listed here, will return false from 'user_is_allowed' # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # Format: # user:resource:chat diff --git a/examples/send-system-status/mycommands.sh b/examples/send-system-status/mycommands.sh index e8f5712..349a7b6 100644 --- a/examples/send-system-status/mycommands.sh +++ b/examples/send-system-status/mycommands.sh @@ -5,7 +5,7 @@ # to show how you can customize bashbot by only editing mycommands.sh # NOTE: this is not tested, simply copied from original source and reworked! # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # # shellcheck disable=SC2154 # shellcheck disable=SC2034 diff --git a/modules/aliases.sh b/modules/aliases.sh index 3750e0b..ffa675f 100644 --- a/modules/aliases.sh +++ b/modules/aliases.sh @@ -5,7 +5,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # # will be automatically sourced from bashbot diff --git a/modules/answerInline.sh b/modules/answerInline.sh index 527eb67..49b7a26 100644 --- a/modules/answerInline.sh +++ b/modules/answerInline.sh @@ -5,7 +5,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # will be automatically sourced from bashbot diff --git a/modules/background.sh b/modules/background.sh index 2277f54..9220aee 100644 --- a/modules/background.sh +++ b/modules/background.sh @@ -5,7 +5,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # will be automatically sourced from bashbot diff --git a/modules/chatMember.sh b/modules/chatMember.sh index f4dadc9..2299c0f 100644 --- a/modules/chatMember.sh +++ b/modules/chatMember.sh @@ -5,7 +5,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # will be automatically sourced from bashbot diff --git a/modules/jsonDB.sh b/modules/jsonDB.sh index ccbd5cd..af6597d 100644 --- a/modules/jsonDB.sh +++ b/modules/jsonDB.sh @@ -5,7 +5,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # # source from commands.sh to use jsonDB functions # diff --git a/modules/sendMessage.sh b/modules/sendMessage.sh index d11a417..449ec28 100644 --- a/modules/sendMessage.sh +++ b/modules/sendMessage.sh @@ -5,7 +5,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ 0.99-17-g9d7f145 +#### $$VERSION$$ v1.0-0-g99217c4 # will be automatically sourced from bashbot diff --git a/mycommands.sh b/mycommands.sh index 27fba90..2a26787 100644 --- a/mycommands.sh +++ b/mycommands.sh @@ -8,7 +8,7 @@ # #### if you start to develop your own bot, use the clean version of this file: # #### mycommands.clean # -#### $$VERSION$$ 0.99-15-g25578bf +#### $$VERSION$$ v1.0-0-g99217c4 # # uncomment the following lines to overwrite info and help messages @@ -74,25 +74,26 @@ NOTBOTADMIN="Sorry, this command is allowed for bot owner only" if [ "$1" = "startbot" ];then ################### - # this function is run once after startup when the first message is received - my_startup(){ - # send message ito first user on startup - send_normal_message "${CHAT[ID]}" "Hi, you was the first one after startup!" - } - # remind bot of start, now uses config store + # this section is processed on startup + + # mark startup, triggers action on first message setConfigKey "startupaction" "await" else - # call my_startup when first message arrives - if [[ "$(getConfigKey "startupaction")" != "done"* ]]; then - _exec_if_function my_startup - setConfigKey "startupaction" "done $(date)" - fi ############################# # your own bashbot commands # NOTE: command can have @botname attached, you must add * to case tests... mycommands() { + ############# + # action triggered on first message after startup + if [[ "$(getConfigKey "startupaction")" != "done"* ]]; then + # send message to first user on startup + send_normal_message "${CHAT[ID]}" "Hi, you was the first one after startup!" + # mark as done and when + setConfigKey "startupaction" "done $(date)" + fi + ############## # a service Message was received # add your own stuff here diff --git a/mycommands.sh.clean b/mycommands.sh.clean index dd00f35..95c1178 100644 --- a/mycommands.sh.clean +++ b/mycommands.sh.clean @@ -4,7 +4,7 @@ # files: mycommands.sh.clean # copy to mycommands.sh and add all your commands and functions here ... # -#### $$VERSION$$ 0.99-4-g15eb311 +#### $$VERSION$$ v1.0-0-g99217c4 # ########## diff --git a/scripts/interactive.sh.clean b/scripts/interactive.sh.clean index 4424af7..4fdc70f 100755 --- a/scripts/interactive.sh.clean +++ b/scripts/interactive.sh.clean @@ -6,7 +6,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ 0.99-5-gaec7345 +#### $$VERSION$$ v1.0-0-g99217c4 ###### # parameters diff --git a/test/ADD-test-new.sh b/test/ADD-test-new.sh index bf3500c..8e56210 100755 --- a/test/ADD-test-new.sh +++ b/test/ADD-test-new.sh @@ -2,7 +2,7 @@ # # ADD a new test skeleton to test dir, but does not activate test # -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # magic to ensure that we're always inside the root of our application, # no matter from which directory we'll run script diff --git a/test/ALL-tests.inc.sh b/test/ALL-tests.inc.sh index cc2555a..a58a56c 100644 --- a/test/ALL-tests.inc.sh +++ b/test/ALL-tests.inc.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # common variables export TESTME DIRME TESTDIR LOGFILE REFDIR TESTNAME diff --git a/test/a-commit-test.sh b/test/a-commit-test.sh index 1d81abe..23232ce 100755 --- a/test/a-commit-test.sh +++ b/test/a-commit-test.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 ../dev/hooks/pre-commit.sh diff --git a/test/b-example-test.sh b/test/b-example-test.sh index 321938f..865e4de 100644 --- a/test/b-example-test.sh +++ b/test/b-example-test.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # file: b-example-test.sh -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # include common functions and definitions # shellcheck source=test/ALL-tests.inc.sh diff --git a/test/c-init-test.sh b/test/c-init-test.sh index 2a13cda..bc3500f 100755 --- a/test/c-init-test.sh +++ b/test/c-init-test.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # include common functions and definitions # shellcheck source=test/ALL-tests.inc.sh diff --git a/test/d-JSON.sh-test.sh b/test/d-JSON.sh-test.sh index 4f70ad2..bf70fa9 100755 --- a/test/d-JSON.sh-test.sh +++ b/test/d-JSON.sh-test.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # include common functions and definitions # shellcheck source=test/ALL-tests.inc.sh diff --git a/test/d-process_inline-test.sh b/test/d-process_inline-test.sh index a9f1cb4..4040435 100755 --- a/test/d-process_inline-test.sh +++ b/test/d-process_inline-test.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # include common functions and definitions # shellcheck source=test/ALL-tests.inc.sh diff --git a/test/d-process_message-test.sh b/test/d-process_message-test.sh index 1513dc6..644cb94 100755 --- a/test/d-process_message-test.sh +++ b/test/d-process_message-test.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # include common functions and definitions # shellcheck source=test/ALL-tests.inc.sh diff --git a/test/d-send_message-test.sh b/test/d-send_message-test.sh index ba8dc19..2ed52ad 100755 --- a/test/d-send_message-test.sh +++ b/test/d-send_message-test.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # include common functions and definitions # shellcheck source=test/ALL-tests.inc.sh diff --git a/test/d-user_is-test.sh b/test/d-user_is-test.sh index 8c03e7e..4046cfa 100755 --- a/test/d-user_is-test.sh +++ b/test/d-user_is-test.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # include common functions and definitions # shellcheck source=test/ALL-tests.inc.sh diff --git a/test/e-env-test.sh b/test/e-env-test.sh index 2499ad3..5247955 100755 --- a/test/e-env-test.sh +++ b/test/e-env-test.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.99-0-g2775000 +#### $$VERSION$$ v1.0-0-g99217c4 # include common functions and definitions # shellcheck source=test/ALL-tests.inc.sh