From f53e9ced17daaf20601f95b1b2011ba09f11e8cb Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Thu, 6 Aug 2020 08:43:28 +0200 Subject: [PATCH] startup example uses config store now --- mycommands.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mycommands.sh b/mycommands.sh index dd94ce2..292b5a3 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-7-gafbdb1e +#### $$VERSION$$ 0.99-11-g3e10396 # # uncomment the following lines to overwrite info and help messages @@ -76,11 +76,14 @@ if [ "$1" = "startbot" ];then # send message ito first user on startup send_normal_message "${CHAT[ID]}" "Hi, you was the first one after startup!" } - # remind bot of start, replace by jsonDB ? - touch .mystartup + # remind bot of start, now uses config store + setConfigKey "startupaction" "await" else - # call my_startup when first message arrives - [ -f .mystartup ] && rm -f .mystartup && _exec_if_function my_startup + # things to do only at source, eg. after startup + if [[ "$(getConfigKey "startupaction")" != "done"* ]]; then + _exec_if_function my_startup + setConfigKey "startupaction" "done $(date)" + fi ############################# # your own bashbot commands