forked from tilderadio/radiobot
fix sending updates if a dj is on
This commit is contained in:
parent
b04e5ac662
commit
7e492f165f
8
bot.sh
8
bot.sh
|
@ -35,14 +35,18 @@ tail -f input.txt | telnet $server $port | while read -r buf
|
|||
do
|
||||
# trim \r's
|
||||
line=$(printf %b "$buf" | tr -d $'\r')
|
||||
|
||||
# log the received line
|
||||
printf "< %s: %s\n" "$(date "+[%y:%m:%d %T]")" "$line"
|
||||
|
||||
# now playing
|
||||
if [ "$now_playing" != "$(<$npfile)" ]; then
|
||||
now_playing=$(<$npfile)
|
||||
[ -n "$dj" ] && \
|
||||
msg "$channel" "\x0303$now_playing"
|
||||
|
||||
# print the new song if a dj is streaming
|
||||
if [ -n "$dj" ]; then
|
||||
msg "#$channel" "\x0303$now_playing"
|
||||
fi
|
||||
fi
|
||||
|
||||
# new dj!
|
||||
|
|
Loading…
Reference in New Issue