forked from tilderadio/radiobot
ok here's a thing
This commit is contained in:
parent
c51c5e02b6
commit
d7cf3771c6
11
bot.sh
11
bot.sh
|
@ -5,6 +5,7 @@ input=".bot.cfg"
|
|||
echo "Starting session: $(date "+[%y:%m:%d %T]")">$log
|
||||
echo "NICK $nick" > $input
|
||||
echo "USER $user" >> $input
|
||||
echo "MODE $nick +B" >> $input
|
||||
echo "JOIN #$channel" >> $input
|
||||
|
||||
|
||||
|
@ -61,6 +62,8 @@ do
|
|||
echo "$res"
|
||||
who=$(echo "$res" | perl -pe "s/:(.*)\!.*@.*/\1/")
|
||||
from=$(echo "$res" | perl -pe "s/.*PRIVMSG (.*[#]?([a-zA-Z]|\-)*) :.*/\1/")
|
||||
echo $who $from
|
||||
|
||||
# "#" would mean it's a channel
|
||||
if [ "$(echo "$from" | grep '^#')" ]; then
|
||||
test "$(echo "$res" | grep ":$nick:")" || continue
|
||||
|
@ -88,6 +91,14 @@ do
|
|||
echo "PRIVMSG $from :${dj:-"no one"} is on the air now" >> $input
|
||||
;;
|
||||
|
||||
help)
|
||||
echo "PRIVMSG $from :hey hi, my commands are subscribe, unsubscribe, np, and dj"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "no command: $res"
|
||||
;;
|
||||
|
||||
esac
|
||||
;;
|
||||
|
||||
|
|
Loading…
Reference in New Issue