diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2020-04-10 17:54:57 -0400 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2020-04-12 19:00:58 -0400 |
commit | 34c7bb23224670246f6845063d0aa64eafabd35b (patch) | |
tree | 347d6468b21a3c2cfb7f4387c85400ec5c51d85b | |
parent | 928bf14af90d2a5c01d8d10659698142dd2aa594 (diff) |
limit length and number of factoids
-rw-r--r-- | process_event | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/process_event b/process_event index 575ebac..8ae2162 100644 --- a/process_event +++ b/process_event @@ -42,7 +42,13 @@ source common_codez function remember_fact { - if grep "^${is}$" "info/${thing}" &>/dev/null + if (( $(wc -l "info/${thing}" 2> /dev/null | cut -d ' ' -f 1) + 0 >= 3 )) + then + send_msg "${channel_it_came_from}" "${personoslash}: Sorry, my pea-brain can not remember so many facts about any one topic." + elif (( $(wc -c <<<${is}) + 0 >= 512 )) + then + send_msg "${channel_it_came_from}" "${personoslash}: Sorry, my pea-brain can not remember such a detailed fact. Could you try \"dumbing it down\" for me?" + elif grep "^${is}$" "info/${thing}" &>/dev/null then send_msg "${channel_it_came_from}" "${personoslash}: Thanks, but I knew that already." else |