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