Add urban dictionary support. Add random line additions and removals. - annna -… | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit deb999d31715062f9420d1a56483fcd0c4a8cfcc | |
parent 219699669d6137663ba3769c321a4dc3a3dc4e03 | |
Author: Annna Robert-Houdin <[email protected]> | |
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(-) | |
--- | |
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 | |
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 -"$((… | |
+ ;; | |
+ 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/bit… | |
+ ;; | |
+ 20) | |
+ purl="No matches found." | |
+ ;; | |
+ *) | |
+ purl="Parazyd destroyed the server. Nothing to… | |
+ ;; | |
+ 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 | |