Implement sleeping and waking up in annna. - annna - Annna the nice friendly bot.
HTML git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
---
DIR commit 669a884c52e6eb2f530adfd2b949262d8305940f
DIR parent 58da3de74532ae89ccc1456b21b2db098a56784e
HTML Author: Annna Robert-Houdin <annna@bitreich.org>
Date: Mon, 26 Aug 2024 21:05:40 +0200
Implement sleeping and waking up in annna.
Diffstat:
M annna-message-common | 8 ++++++++
M annna-say | 1 +
2 files changed, 9 insertions(+), 0 deletions(-)
---
DIR diff --git a/annna-message-common b/annna-message-common
@@ -1631,6 +1631,14 @@ done
[ $ismember -lt 1 ] && exit
case "${text}" in
+"${ircuser}, please go to sleep.")
+ annna-say -s "${server}" -c "${channel}" "Going to sleep ... Zzzz ..."
+ touch "${ircbase}/annna-is-sleeping"
+ ;;
+"${ircuser}, please wake up.")
+ rm -f "${ircbase}/annna-is-sleeping"
+ annna-say -s "${server}" -c "${channel}" "Good morning BITREICH!"
+ ;;
"${ircuser}, can you show me the uptime please?")
annna-say -s "${server}" -c "${channel}" "$(hostname) uptime: $(uptime)"
;;
DIR diff --git a/annna-say b/annna-say
@@ -46,6 +46,7 @@ shift $(expr $OPTIND - 1)
# If annna is not alive, do not bother.
annna-alive || exit 0
+[ -e "${ircbase}/annna-is-sleeping" ] && exit 0
for c in $channels;
do