Tried to handle quitting gracefully, but not working so far.
This commit is contained in:
parent
056eec6025
commit
af18b6c47a
@ -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.
|
||||
|
15
functions.sh
15
functions.sh
@ -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 $?
|
||||
|
Loading…
Reference in New Issue
Block a user