annna-message-common: generate random Bach audio on request - 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 eb4dce47da7a2d2415d233f053e9135e255c2787 DIR parent 181019165f861c28b8e7089328baff2b8dfe1fca HTML Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Fri, 9 Aug 2024 12:01:07 +0200 annna-message-common: generate random Bach audio on request Signed-off-by: Annna Robert-Houdin <annna@bitreich.org> Diffstat: M annna-message-common | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) --- DIR diff --git a/annna-message-common b/annna-message-common @@ -361,7 +361,7 @@ case "${text}" in fortunecookie="$(fortune-cookie)" if [ -n "${fortunecookie}" ]; then - annna-say -s "${server}" -c "${channel}" "${user}, ${fortunecookie}" + annna-say -s "${server}" -c "${channel}" "${user}, ${fortunecookie}" fi ;; "${ircuser}, what is "*) @@ -1112,6 +1112,15 @@ case "${text}" in | head -n 1)" annna-say -s "${server}" -c "${channel}" "${user}, I think ${pick} is the best option." ;; +"${ircuser}, please play some Bach"*) + midifile="$(find . /home/annna/bin/modules/midi-media/bach -name '*.mid' \ + | sort -R \ + | head -n 1)" + outfile="/br/gopher/midi/${midifile##*/}.ogg" + if play-midi "$midifile" >"$outfile"; then + annna-say -s "${server}" -c "${channel}" "${user}, gophers://bitreich.org/9/memecache/filter/${outfile##*/}" + fi + ;; "${ircuser}, please antidepressant #"*|\ "${ircuser}, please amplify #"*|\ "${ircuser}, please amsterdamify #"*|\