Fix annna picking service. - 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 6428e3fa3538a9c3272ff1f78712d464439fc99c DIR parent ad3d737f0390763d9a9c060f0bb139d3779863d4 HTML Author: Annna Robert-Houdin <annna@bitreich.org> Date: Sun, 17 Oct 2021 21:29:37 +0200 Fix annna picking service. Diffstat: M annna-message-common | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) --- DIR diff --git a/annna-message-common b/annna-message-common @@ -768,6 +768,15 @@ case "${text}" in "${botname}, please give me a penis extension.") annna-say -c "${channel}" "${user}, here: $(penis-extension)" ;; +"${botname}, please pick one of: "*) + pick="$(printf '%s\n' "${text}" \ + | sed 's/.*please pick one of: //' \ + | tr ',' '\n' \ + | tr -d ' ' \ + | sort -R \ + | head -n 1)" + annna-say -c "${channel}" "${user}, I think ${pick} is the best option." + ;; "${botname}, please amsterdamify #"*|\ "${botname}, please banjo #"*|\ "${botname}, please bounce #"*|\ @@ -814,10 +823,6 @@ case "${text}" in } & exit 0 ;; -"${botname}, please pick one of: ") - pick="$(printf '%s\n' "${text}" | sed 's/.*please pick one of://' | tr ',' '\n' | sort -R | head -n 1)" - annna-say -c "${channel}" "${user}, I think ${pick} is the best option." - ;; "${botname}, please help.") # Help Message. # TODO: Add multiple line support to annna-say -c(1) with sleep.