Add clippy support for horoscope. - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit 5348fde77ab4f989ff3a290d6d4880b140ab229e | |
parent bf3a6570027e66a947ed7896a65ce00c81ea58aa | |
Author: Annna Robert-Houdin <[email protected]> | |
Date: Sun, 24 May 2020 18:56:45 +0200 | |
Add clippy support for horoscope. | |
Diffstat: | |
M annna-start-services | 46 +++++++++++++++++------------… | |
1 file changed, 26 insertions(+), 20 deletions(-) | |
--- | |
diff --git a/annna-start-services b/annna-start-services | |
@@ -140,28 +140,34 @@ annna_common() { | |
;; | |
esac | |
- purl="" | |
- dresult="$(dict "dict://parazyd.org/d:${word}")" | |
- derr=$? | |
- if [ $derr -eq 20 ]; | |
- then | |
- dresult="$(dict "dict://parazyd.org/d:${word}")" | |
- derr2="$?" | |
- [ $derr2 -ne $derr ] && derr=$derr2 | |
- fi | |
- case "$derr" in | |
- 0|21) | |
- purl="$(printf "%s" "${dresult}" | /br/bin/bitreich-pa… | |
- ;; | |
- 20) | |
- purl="No matches found." | |
- ;; | |
- 1) | |
- purl="Parse error." | |
+ case "${word}" in | |
+ "is my horoscope") | |
+ purl="$(clippy-say "Did you mean _what's my horoscope?… | |
;; | |
*) | |
- purl="Parazyd destroyed the server. Nothing to see her… | |
- ;; | |
+ purl="" | |
+ dresult="$(dict "dict://parazyd.org/d:${word}")" | |
+ derr=$? | |
+ if [ $derr -eq 20 ]; | |
+ then | |
+ dresult="$(dict "dict://parazyd.org/d:${word}"… | |
+ derr2="$?" | |
+ [ $derr2 -ne $derr ] && derr=$derr2 | |
+ fi | |
+ case "$derr" in | |
+ 0|21) | |
+ purl="$(printf "%s" "${dresult}" | /br/bin/bit… | |
+ ;; | |
+ 20) | |
+ purl="No matches found." | |
+ ;; | |
+ 1) | |
+ purl="Parse error." | |
+ ;; | |
+ *) | |
+ purl="Parazyd destroyed the server. Nothing to… | |
+ ;; | |
+ esac | |
esac | |
annna-say -c "${channel}" "${purl}" | |
;; |