pull notify_channels into a config var and grab slogans
This commit is contained in:
parent
21591ad8db
commit
0a3b06ab0f
|
@ -2,5 +2,7 @@ server="localhost"
|
||||||
port="6667"
|
port="6667"
|
||||||
npfile="now_playing.txt"
|
npfile="now_playing.txt"
|
||||||
channel="tilderadio"
|
channel="tilderadio"
|
||||||
|
notify_channels="meta team yourtilde $channel"
|
||||||
|
link="https://bhh.sh/listen"
|
||||||
nick="radiobot"
|
nick="radiobot"
|
||||||
log="log.txt"
|
log="log.txt"
|
||||||
|
|
37
bot.sh
37
bot.sh
|
@ -30,21 +30,17 @@ do
|
||||||
if [[ $dj != $(parse_dj) ]]; then
|
if [[ $dj != $(parse_dj) ]]; then
|
||||||
dj=$(parse_dj)
|
dj=$(parse_dj)
|
||||||
if [[ ! -z "${dj}" ]]; then
|
if [[ ! -z "${dj}" ]]; then
|
||||||
echo "PRIVMSG #$channel :$dj is now online! tune in now here: https://bhh.sh/listen" >> $input
|
for chan in $notify_channels; do
|
||||||
echo "PRIVMSG #meta :$dj is now online! tune in now here: https://bhh.sh/listen" >> $input
|
echo "PRIVMSG #$chan :$dj is now online! tune in now here: $link" >> $input
|
||||||
echo "PRIVMSG #music :$dj is now online! tune in now here: https://bhh.sh/listen" >> $input
|
done
|
||||||
echo "PRIVMSG #yourtilde :$dj is now online! tune in now here: https://bhh.sh/listen" >> $input
|
|
||||||
|
|
||||||
while read -u 10 subscriber; do
|
while read -u 10 subscriber; do
|
||||||
echo "PRIVMSG $subscriber :$dj is now online! tune in now here: https://bhh.sh/listen" >> $input
|
echo "PRIVMSG $subscriber :$dj is now online! tune in now here: $link" >> $input
|
||||||
done 10< subscribers.txt
|
done 10< subscribers.txt
|
||||||
# @tilderadio@tilde.zone
|
|
||||||
TOOT_JSON_PATH=. toot "dj $dj is now streaming live on https://tilderadio.org! tune in here: https://bhh.sh/listen"
|
|
||||||
# @yourtilde@tilde.zone
|
|
||||||
TOOT_JSON_PATH=./yourtilde toot "dj $dj is now streaming live on https://tilderadio.org! tune in here: https://bhh.sh/listen"
|
|
||||||
|
|
||||||
# @tildeteam@tilde.zone
|
for json in . ./yourtilde ./team; do
|
||||||
toot "dj $dj is now streaming live on https://tilderadio.org! tune in here: https://bhh.sh/listen"
|
TOOT_JSON_PATH=$json toot "dj $dj is now streaming live on https://tilderadio.org! tune in here: $link"
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -63,10 +59,9 @@ do
|
||||||
|
|
||||||
# make sure we're joined
|
# make sure we're joined
|
||||||
*376*|*404*)
|
*376*|*404*)
|
||||||
echo "JOIN #$channel" >> $input
|
for chan in $notify_channels; do
|
||||||
echo "JOIN #meta" >> $input
|
echo "JOIN #$chan" >> $input
|
||||||
echo "JOIN #music" >> $input
|
done
|
||||||
echo "JOIN #yourtilde" >> $input
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# run when a message is seen
|
# run when a message is seen
|
||||||
|
@ -89,8 +84,12 @@ do
|
||||||
|
|
||||||
case "$com" in
|
case "$com" in
|
||||||
subscribe)
|
subscribe)
|
||||||
|
if grep -q $who subscribers.txt; then
|
||||||
|
echo "PRIVMSG $from :you're already subscribed! :)" >> $input
|
||||||
|
else
|
||||||
echo $who >> subscribers.txt
|
echo $who >> subscribers.txt
|
||||||
echo "PRIVMSG $from :i'll send you a direct message when a dj starts streaming!" >> $input
|
echo "PRIVMSG $from :i'll send you a direct message when a dj starts streaming!" >> $input
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
unsubscribe)
|
unsubscribe)
|
||||||
|
@ -111,15 +110,15 @@ do
|
||||||
;;
|
;;
|
||||||
|
|
||||||
link)
|
link)
|
||||||
echo "PRIVMSG $from :https://bhh.sh/listen" >> $input
|
echo "PRIVMSG $from :$link" >> $input
|
||||||
;;
|
;;
|
||||||
|
|
||||||
help)
|
help)
|
||||||
echo "PRIVMSG $from :hey hi, my commands are subscribe, unsubscribe, np, and dj" >> $input
|
echo "PRIVMSG $from :hey hi, my commands are subscribe, unsubscribe, np, dj, link, radio" >> $input
|
||||||
;;
|
;;
|
||||||
|
|
||||||
radio)
|
radio|slogan)
|
||||||
echo "PRIVMSG $from :eat the poop or die!!1" >> $input
|
echo "PRIVMSG $from :$(curl -s https://ben.ttm.sh/slogans.txt | shuf -n1)" >> $input
|
||||||
;;
|
;;
|
||||||
|
|
||||||
paymybills)
|
paymybills)
|
||||||
|
|
Reference in New Issue