forked from tilderadio/radiobot
fix dj match
This commit is contained in:
parent
e25191a53d
commit
fcf48a3ca0
4
bot.sh
4
bot.sh
|
@ -10,7 +10,7 @@ echo "USER $user" >> $input
|
|||
echo "JOIN #$channel" >> $input
|
||||
|
||||
function parse_dj {
|
||||
echo $now_playing | grep -Eo '\([^)]*\)' | sed 's/[()]//g'
|
||||
echo $now_playing | grep -Eo '^\([^)]*\)' | sed 's/[()]//g'
|
||||
}
|
||||
|
||||
tail -f $input | telnet $server $port | while read res
|
||||
|
@ -21,7 +21,7 @@ do
|
|||
# now playing
|
||||
if [[ $now_playing != "$(<$now_playing_file)" ]]; then
|
||||
now_playing=$(<$now_playing_file)
|
||||
echo "PRIVMSG #tilderadio :$now_playing" >> $input
|
||||
echo -e "PRIVMSG #tilderadio :\x0303$now_playing" >> $input
|
||||
fi
|
||||
|
||||
if [[ $dj != $(parse_dj) ]]; then
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
$json = json_decode(file_get_contents('php://input'));
|
||||
|
||||
$msg = "\x0303";
|
||||
$msg = "";
|
||||
|
||||
if ($json->live->is_live)
|
||||
$msg .= "({$json->live->streamer_name}) ";
|
||||
|
|
Loading…
Reference in New Issue