Greet/leave messages can now be turned on and off.

This commit is contained in:
Storm Dragon 2016-09-04 13:15:35 -04:00
parent a5706b025b
commit 4f525e713f
2 changed files with 14 additions and 8 deletions

View File

@ -1,11 +1,17 @@
server="irc.netwirc.tk"
port=6667
#enter channels here in quotes before the )
channel=(
"a11y"
)
nick="storm_bot"
# format=username hostname servername :realname
user="$nick ${server%.} $server :$nick"
# Greet people who enter the channel? (true/false)
# Configure greetings in triggers/greet/greet.sh
greet=true
# Say something when people leave the channel? (true/false)
# Configure bye messages in triggers/bye/bye.sh
leave=true
# Path to log file
log="log.txt"
nick="storm_bot"
port=6667
server="irc.netwirc.tk"
# format=username hostname servername :realname
user="$nick ${server%.} $server :$nick"

6
bot.sh
View File

@ -33,10 +33,10 @@ do
continue
fi
echo "MODE #$channel +o $who" >> $input
./triggers/greet/greet.sh $who $chan
[ "${greet,,}" = "true" ] && ./triggers/greet/greet.sh $who $chan
;;
# run when someone leaves
*PART #*)
*"PART #"*)
who=$(echo "$res" | perl -pe "s/:(.*)\!.*@.*/\1/")
chan="$(echo "$res" | cut -d '#' -f2)"
chan="#$chan"
@ -44,7 +44,7 @@ do
continue
fi
echo "MODE #$channel +o $who" >> $input
./triggers/greet/bye.sh $who $chan
[ "${leave,,}" = "TRUE" ] && ./triggers/bye/bye.sh $who $chan
;;
# run when a message is seen
*PRIVMSG*)