diff options
author | Joseph Graham <joseph@fibreglass.tunachunks> | 2014-01-22 15:07:54 +0000 |
---|---|---|
committer | Joseph Graham <joseph@fibreglass.tunachunks> | 2014-01-22 15:07:54 +0000 |
commit | 19f682d65caa5ef04c9b021a21842dc70efb97c8 (patch) | |
tree | 684c1569ef94cc94a5556eeb34c8917c7584193f | |
parent | 4aa03b52f82e5d1f495351c1dd07e30988f902b7 (diff) |
Make him work better when some idiot tells him to tell himself something.
-rw-r--r-- | hack_of_all_hacks | 13 |
1 files 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}: }" |