Fixed reminders involving tells, added multiple word detection example in keywords.

This commit is contained in:
Storm Dragon 2016-09-16 22:00:59 -04:00
parent 387432cdcd
commit b6f2351a0e
3 changed files with 9 additions and 1 deletions

View File

@ -17,6 +17,9 @@ else
message="I have 2 greate big ol' hairy balls. You wanna touch 'em?" message="I have 2 greate big ol' hairy balls. You wanna touch 'em?"
fi fi
;; ;;
"does god exist?"|"is god real?"|"is there a god?")
message="According to your $(shuf -e -n1 "mother" "daughter" "sister" "wife" "grandmother" "girl friend") I am God. She kept screaming it at me all last night, \"OH GOD ${nick^^} DON'T STOP!\""
;;
*) *)
message="$(shuf -n1 -e "yes" "no" "maybe" "ask again later")." message="$(shuf -n1 -e "yes" "no" "maybe" "ask again later")."
esac esac

View File

@ -18,7 +18,7 @@ else
msg "$chan" "ok, $userNick, reminder in $time." msg "$chan" "ok, $userNick, reminder in $time."
reminderMessage="$@" reminderMessage="$@"
if [[ "$reminderMessage" =~ ^[Tt]ell* ]]; then if [[ "$reminderMessage" =~ ^[Tt]ell* ]]; then
userNick="$(echo "$reminderMessage" | rev | cut -d ' ' -f2 | rev)" userNick="$(echo "${reminderMessage#[T|t]ell }" | cut -d ' ' -f1)"
reminderMessage="${reminderMessage#[Tt]ell }" reminderMessage="${reminderMessage#[Tt]ell }"
reminderMessage="${reminderMessage#* }" reminderMessage="${reminderMessage#* }"
fi fi

View File

@ -19,3 +19,8 @@ if [[ -n "${keywords[${w,,}]}" ]]; then
eval ${keywords[${w,,}]} eval ${keywords[${w,,}]}
fi fi
done done
# Example of dealing with multi word triggers.
if [[ "${wordList//[[:space:]]}" =~ .*nowplaying.* ]]; then
act "$chan" "cranks the volume up to 11!"
fi