Add color weather support. - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit 372e056f8f6d3f389df1c262b4398959525a7f3e | |
parent c990180f2232737b76dce75d6e2cb9add10e2303 | |
Author: Annna Robert-Houdin <[email protected]> | |
Date: Sun, 15 Jun 2025 21:35:21 +0200 | |
Add color weather support. | |
Thanks pazz0, for the idea! | |
Diffstat: | |
M annna-message-common | 22 ++++++++++++++++++++++ | |
1 file changed, 22 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/annna-message-common b/annna-message-common | |
@@ -958,6 +958,28 @@ case "${text}" in | |
fi | |
} & | |
;; | |
+"${ircuser}, color weather at "*|"${ircuser}, color weather in "*) | |
+ { | |
+ weatherplace="$(printf "%s\n" "${text}" \ | |
+ | sed 's,.*color weather .. \(.*\),\1,' \ | |
+ | tr -d '?')" | |
+ personality="color-weather-reporter" | |
+ preprompt="$(cat ${modbase}/prompt-agents/${personality}.promp… | |
+ if weathertext="$(weather "${weatherplace}")" | |
+ then | |
+ prompt="$(printf "%s\n" "${weathertext}" | cut -d' ' -… | |
+ { | |
+ annna-say -s "${server}" -c "${channel}" "${us… | |
+ } & | |
+ else | |
+ weathertext="there is no weather at ${weatherplace}" | |
+ prompt="${weathertext}" | |
+ { | |
+ annna-say -s "${server}" -c "${channel}" "${us… | |
+ } & | |
+ fi | |
+ } & | |
+ ;; | |
"${ircuser}, METAR for "*|"${ircuser}, metar for "*|"${ircuser}, metar for "*|… | |
resp=$(metar "$(printf '%.4s\n' "${text##* }")") | |
annna-say -s "${server}" -c "${channel}" "${user}, ${resp}" |