Make the bot work with a new ii versions
This commit is contained in:
parent
c7a3c4a7c0
commit
c1731d0c5d
10
start.sh
10
start.sh
@ -139,6 +139,8 @@ transparenzbericht() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
seen() {
|
seen() {
|
||||||
|
# TODO the newer ii saves unix timestamps. We could detect that and
|
||||||
|
# parse it on output (or input)
|
||||||
[ -z "$1" ] && return
|
[ -z "$1" ] && return
|
||||||
[ -f "$BOTDIR/seen/$1" ] \
|
[ -f "$BOTDIR/seen/$1" ] \
|
||||||
&& say "$(cat "$BOTDIR/seen/$1")" \
|
&& say "$(cat "$BOTDIR/seen/$1")" \
|
||||||
@ -196,6 +198,14 @@ do
|
|||||||
NICK=$(echo "$line" \
|
NICK=$(echo "$line" \
|
||||||
| sed -n 's/^....-..-.. ..:.. <\([^>]*\).*/\1/p')
|
| 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.
|
# prevent loops; so the bot can't trigger itself.
|
||||||
[ "$NICK" == "$BOTNICK" ] \
|
[ "$NICK" == "$BOTNICK" ] \
|
||||||
&& continue
|
&& continue
|
||||||
|
Loading…
Reference in New Issue
Block a user