Tried to handle quitting gracefully, but not working so far.

This commit is contained in:
Storm Dragon 2016-09-05 13:54:42 -04:00
parent 056eec6025
commit af18b6c47a
2 changed files with 17 additions and 0 deletions

View File

@ -12,6 +12,8 @@ leave=true
log="log.txt"
nick="storm_bot"
port=6667
# Message to give when the bot logs off the server
quitMessage="$nick vanishes in a sudden flash of brilliant lightning."
server="irc.netwirc.tk"
# format=username hostname servername :realname
# Triggers, symbols, that when starting a message, will cause the bot to search modules.

View File

@ -11,6 +11,13 @@ shift
echo "$msg $@" | tee -a "$input"
}
reply()
{
shift
local msg="PRIVMSG $1 :"
echo "$msg $@" | tee -a "$input"
}
act()
{
local msg="PRIVMSG $1 :\x01ACTION"
@ -18,3 +25,11 @@ shift
echo -e "$msg $@\x01" | tee -a "$input"
}
close_bot()
{
echo "QUIT :$quitMessage" >> "$input"
echo "exiting..."
sleep 10
}
trap close_bot EXIT $?