Add clippy support for horoscope. - 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 5348fde77ab4f989ff3a290d6d4880b140ab229e
DIR parent bf3a6570027e66a947ed7896a65ce00c81ea58aa
HTML Author: Annna Robert-Houdin <annna@bitreich.org>
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(-)
---
DIR 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-paste)"
- ;;
- 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 here."
- ;;
+ 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-paste)"
+ ;;
+ 20)
+ purl="No matches found."
+ ;;
+ 1)
+ purl="Parse error."
+ ;;
+ *)
+ purl="Parazyd destroyed the server. Nothing to see here."
+ ;;
+ esac
esac
annna-say -c "${channel}" "${purl}"
;;