show date diff on schedule command
This commit is contained in:
parent
df6e17bcbd
commit
ac94486c80
3
bot.sh
3
bot.sh
|
@ -182,7 +182,8 @@ do
|
|||
json=$(curl -s "https://radio.tildeverse.org/api/station/1/schedule?rows=1" | jq ".[]")
|
||||
nextdj=$(jq -r .name <<< "$json")
|
||||
nexttime=$(LANG=C TZ=UTC date -d "$(jq -r .start <<< "$json")")
|
||||
msg "$from" "$schedule - $nextdj will be on at $nexttime"
|
||||
timediff=$(TZ=UTC awk -v d="$nexttime" 'BEGIN { then=mktime(d); now=systime(); print strftime("%Hh %Mm", then - now); }')
|
||||
msg "$from" "$schedule - $nextdj will be on at $nexttime (in $timediff)"
|
||||
;;
|
||||
|
||||
help)
|
||||
|
|
Reference in New Issue