summaryrefslogtreecommitdiff
path: root/bin/ii-answer
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ii-answer')
-rwxr-xr-xbin/ii-answer13
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/ii-answer b/bin/ii-answer
index 06bc3c0..779e1e9 100755
--- a/bin/ii-answer
+++ b/bin/ii-answer
@@ -115,4 +115,17 @@ find "${irc_dir}" \
printf 'np\n' | \
irc_say "${channel}" 'copy'
fi
+ if [ -z "${channel%%#*}" ]; then
+ # answer "Shut up!"
+ regex='^\S\+ <\S\+> .* [Ss][Hh][Uu][Tt] \?[Uu][Pp]'
+ if grep "${regex}" "${out_file}" | \
+ grep -q "${sloppy_salutation}"; then
+ sed -i "/${regex}/d" "${out_file}"
+ printf '%s\n' "$((
+ $(date '+%s') + 3600
+ ))" > "${work_dir}/irc-shut-up"
+ printf 'Sorry, I will do.\n' | \
+ irc_say "${channel}" 'copy'
+ fi
+ fi
done