!seen, parse timestamp
This commit is contained in:
parent
b5cc10a0cc
commit
477d1245f6
17
start.sh
17
start.sh
@ -137,14 +137,19 @@ transparenzbericht() {
|
||||
say "$i: $(cat "$i") Gummipunkte"
|
||||
done
|
||||
}
|
||||
|
||||
t
|
||||
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")" \
|
||||
|| say "Hmm, ich habe keine Ahnung wann $1 zum letzten mal online war."
|
||||
if [ -f "$BOTDIR/seen/$1" ]
|
||||
then
|
||||
_l="$(cat "$BOTDIR/seen/$1")"
|
||||
_ts="$(echo "$_l" cut -d" " -f1)"
|
||||
_msg="$(echo "$_l" cut -d" " -f2-)"
|
||||
_dt="$(date -r "$_ts" +"%Y-%m-%d %M:%H")"
|
||||
say "$_dt $_msg"
|
||||
else
|
||||
say "Hmm, ich habe keine Ahnung wann $1 zum letzten mal online war."
|
||||
fi
|
||||
}
|
||||
|
||||
usage() {
|
||||
|
Loading…
Reference in New Issue
Block a user