coin module.

This commit is contained in:
Storm Dragon
2016-09-05 21:44:04 -04:00
parent af18b6c47a
commit d9b180deb3
6 changed files with 64 additions and 16 deletions

View File

@ -1,35 +1,26 @@
#!/bin/bash
if [ -z "$input" ]; then
input=".bot.cfg"
input=".botinput"
fi
msg()
{
local msg="PRIVMSG $1"
local msg="PRIVMSG $1 :"
shift
echo "$msg $@" | tee -a "$input"
echo -en "${msg}$@\r\n" | tee -a "$input"
}
reply()
{
shift
local msg="PRIVMSG $1 :"
echo "$msg $@" | tee -a "$input"
echo -en "${msg}$@\r\n" | tee -a "$input"
}
act()
{
local msg="PRIVMSG $1 :\x01ACTION"
shift
echo -e "$msg $@\x01" | tee -a "$input"
echo -en "$msg $@\x01\r\n" | tee -a "$input"
}
close_bot()
{
echo "QUIT :$quitMessage" >> "$input"
echo "exiting..."
sleep 10
}
trap close_bot EXIT $?