From 19f682d65caa5ef04c9b021a21842dc70efb97c8 Mon Sep 17 00:00:00 2001 From: Joseph Graham Date: Wed, 22 Jan 2014 15:07:54 +0000 Subject: Make him work better when some idiot tells him to tell himself something. --- hack_of_all_hacks | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/hack_of_all_hacks b/hack_of_all_hacks index 13d3db1..31dd0da 100644 --- a/hack_of_all_hacks +++ b/hack_of_all_hacks @@ -250,11 +250,16 @@ EOF message="${process#*:}" message="${message# }" - [[ -d "announcements/people/${subject}" ]] || mkdir -p "announcements/people/${subject}" - echo "${personoslash} told me to tell you: ${message}" >> "announcements/people/${subject}/messages" + if "${subject}" == "${my_own_name}" + then + send_msg "${channel_it_came_from}" "${my_own_name}: ${personoslash} told me to tell you: ${message}" + else + [[ -d "announcements/people/${subject}" ]] || mkdir -p "announcements/people/${subject}" + echo "${personoslash} told me to tell you: ${message}" >> "announcements/people/${subject}/messages" - response=$(shuf -e 'certainly' 'I will do' 'OK' | head -1) - send_msg "${channel_it_came_from}" "${personoslash}: ${response}" + response=$(shuf -e 'certainly' 'I will do' 'OK' | head -1) + send_msg "${channel_it_came_from}" "${personoslash}: ${response}" + fi ;; "${my_own_name}: "+([![:space:]])" is "+([![:space:]])* ) declare -l thing="${sentence#${my_own_name}: }" -- cgit v1.2.3