From 7f19dfd1616945c7e8ee9f41bee610d4ef1ffbe5 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 4 Jun 2018 09:45:25 +0200 Subject: bin/ii-answer,lib/common-functions: irc now turn-off-able --- bin/ii-answer | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'bin/ii-answer') 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 -- cgit v1.2.3-70-g09d2