Cleaning up code, added triggers, The bot now greets people when they enter the room.

This commit is contained in:
Storm Dragon
2016-09-03 01:38:30 -04:00
parent b5b5dc1d10
commit ed0fbcb89b
4 changed files with 23 additions and 5 deletions

6
bot.sh
View File

@ -33,7 +33,7 @@ do
continue
fi
echo "MODE #$channel +o $who" >> $input
[ -e greeting.txt ] && msg "$chan" "$who: $(shuf -n1 greeting.txt)"
./triggers/greet/greet.sh $who $chan
;;
# run when a message is seen
*PRIVMSG*)
@ -53,10 +53,10 @@ do
com=$(echo "$will" | cut -d " " -f1)
if [ -z "$(ls modules/ | grep -i -- "$com")" ] || [ -z "$com" ]
then
./modules/help/help.sh $who $from >> $input
./modules/help/help.sh $who $from
continue
fi
./modules/$com/$com.sh $who $from $(echo "$will" | cut -d " " -f2-99) >> $input
./modules/$com/$com.sh $who $from $(echo "$will" | cut -d " " -f2-99)
;;
*)
echo "$res"