Add urban dictionary support. Add random line additions and removals. - 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 deb999d31715062f9420d1a56483fcd0c4a8cfcc DIR parent 219699669d6137663ba3769c321a4dc3a3dc4e03 HTML Author: Annna Robert-Houdin <annna@bitreich.org> Date: Thu, 12 Apr 2018 19:38:13 +0200 Add urban dictionary support. Add random line additions and removals. Diffstat: M annna-alive | 1 + M annna-start-services | 29 ++++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) --- DIR diff --git a/annna-alive b/annna-alive @@ -6,6 +6,7 @@ # if annna-alive; then do-something; fi # + [ -z "$(pgrep -U annna -x socat)" ] && exit 1 exit 0 DIR diff --git a/annna-start-services b/annna-start-services @@ -101,6 +101,34 @@ then continue fi + case "${text}" in + "${botname}, what is "*) + word="$(printf "%s\n" "${text}" | cut -c 16-)" + case "$word" in + *\?) + word="$(printf "%s\n" "${word}" | cut -c -"$(($(expr length "${word}") - 1))")" + ;; + esac + + word="$(printf "%s\n" "${word}" | sed 's, ,_,g')" + + purl="" + dresult="$(dict "dict://parazyd.org/d:${word}")" + case "$?" in + 0|21) + purl="$(printf "%s" "${dresult}" | /br/bin/bitreich-paste)" + ;; + 20) + purl="No matches found." + ;; + *) + purl="Parazyd destroyed the server. Nothing to see here." + ;; + esac + annna-say -c '#bitreich-en' "${purl}" + ;; + esac + ismember=0 for member in $brmembers; do @@ -124,7 +152,6 @@ then annna-say -c "#bitreich-en" "(▀Ĺ▀ )" ;; esac - continue; fi