mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-11-10 11:30:56 +00:00
startup example uses config store now
This commit is contained in:
parent
3e10396e2e
commit
f53e9ced17
@ -8,7 +8,7 @@
|
|||||||
# #### if you start to develop your own bot, use the clean version of this file:
|
# #### if you start to develop your own bot, use the clean version of this file:
|
||||||
# #### mycommands.clean
|
# #### mycommands.clean
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ 0.99-7-gafbdb1e
|
#### $$VERSION$$ 0.99-11-g3e10396
|
||||||
#
|
#
|
||||||
|
|
||||||
# uncomment the following lines to overwrite info and help messages
|
# 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 message ito first user on startup
|
||||||
send_normal_message "${CHAT[ID]}" "Hi, you was the first one after startup!"
|
send_normal_message "${CHAT[ID]}" "Hi, you was the first one after startup!"
|
||||||
}
|
}
|
||||||
# remind bot of start, replace by jsonDB ?
|
# remind bot of start, now uses config store
|
||||||
touch .mystartup
|
setConfigKey "startupaction" "await"
|
||||||
else
|
else
|
||||||
# call my_startup when first message arrives
|
# things to do only at source, eg. after startup
|
||||||
[ -f .mystartup ] && rm -f .mystartup && _exec_if_function my_startup
|
if [[ "$(getConfigKey "startupaction")" != "done"* ]]; then
|
||||||
|
_exec_if_function my_startup
|
||||||
|
setConfigKey "startupaction" "done $(date)"
|
||||||
|
fi
|
||||||
|
|
||||||
#############################
|
#############################
|
||||||
# your own bashbot commands
|
# your own bashbot commands
|
||||||
|
Loading…
Reference in New Issue
Block a user