From c1731d0c5d29eb762455f6ed68ed7a045f05ea11 Mon Sep 17 00:00:00 2001 From: c0dev0id Date: Sun, 5 Feb 2023 10:09:45 +0100 Subject: [PATCH] Make the bot work with a new ii versions --- start.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/start.sh b/start.sh index 11b6bf9..116886c 100755 --- a/start.sh +++ b/start.sh @@ -139,6 +139,8 @@ transparenzbericht() { } seen() { + # TODO the newer ii saves unix timestamps. We could detect that and + # parse it on output (or input) [ -z "$1" ] && return [ -f "$BOTDIR/seen/$1" ] \ && say "$(cat "$BOTDIR/seen/$1")" \ @@ -196,6 +198,14 @@ do NICK=$(echo "$line" \ | sed -n 's/^....-..-.. ..:.. <\([^>]*\).*/\1/p') + if [ -z "$NICK" ] + then + + # the newer ii is using unix timestamps + NICK=$(echo "$line" \ + | sed -n 's/^[0-9]* <\([^>]*\).*/\1/p') + fi + # prevent loops; so the bot can't trigger itself. [ "$NICK" == "$BOTNICK" ] \ && continue