stormbot/functions.sh

36 lines
412 B
Bash
Raw Normal View History

#!/bin/bash
if [ -z "$input" ]; then
input=".bot.cfg"
fi
msg()
{
local msg="PRIVMSG $1"
shift
echo "$msg $@" | tee -a "$input"
}
reply()
{
shift
local msg="PRIVMSG $1 :"
echo "$msg $@" | tee -a "$input"
}
2016-09-04 12:43:22 -04:00
act()
{
local msg="PRIVMSG $1 :\x01ACTION"
shift
echo -e "$msg $@\x01" | tee -a "$input"
}
close_bot()
{
echo "QUIT :$quitMessage" >> "$input"
echo "exiting..."
sleep 10
}
trap close_bot EXIT $?