fix join and it works now!

This commit is contained in:
Ben Harris 2018-10-23 10:10:20 -04:00
parent fe38f96235
commit 5c2a2fca14
2 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,6 @@
server="localhost"
port="6667"
now_playing_file="/home/ben/public_html/now_playing.txt"
now_playing_file="/home/ben/public_html/radio/now_playing.txt"
channel="tilderadio"
nick="radiobot"
user="radiobot tilderadio radiobot :radiobot"

12
bot.sh
View File

@ -2,7 +2,7 @@
. bot.properties
input=".bot.cfg"
now_playing=$(cat $now_playing_file)
now_playing=$(<$now_playing_file)
echo "Starting session: $(date "+[%y:%m:%d %T]")">$log
echo "NICK $nick" > $input
echo "USER $user" >> $input
@ -14,8 +14,8 @@ do
echo "$(date "+[%y:%m:%d %T]")$res" >> $log
# now playing
if [$now_playing != $(cat $now_playing_file)]; then
now_playing=$(cat $now_playing_file)
if [[ $now_playing != "$(<$now_playing_file)" ]]; then
now_playing=$(<$now_playing_file)
echo "PRIVMSG #tilderadio :Now Playing on tilderadio: $now_playing" >> $input
fi
@ -25,6 +25,12 @@ do
PING*)
echo "$res" | sed "s/I/O/" >> $input
;;
# make sure we're joined
*376*|*404*)
echo "JOIN #$channel" >> $input
;;
# else
*)
echo "$res"