!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"
|
say "$i: $(cat "$i") Gummipunkte"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
t
|
||||||
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" ] \
|
if [ -f "$BOTDIR/seen/$1" ]
|
||||||
&& say "$(cat "$BOTDIR/seen/$1")" \
|
then
|
||||||
|| say "Hmm, ich habe keine Ahnung wann $1 zum letzten mal online war."
|
_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() {
|
usage() {
|
||||||
|
Loading…
Reference in New Issue
Block a user