38 lines
495 B
Bash
38 lines
495 B
Bash
#!/bin/bash
|
|
|
|
if [[ -z "$input" ]]; then
|
|
input="$(mktemp .XXXXXX)"
|
|
fi
|
|
|
|
close_bot() {
|
|
echo -en "QUIT :${quitMessage}\r\n" >> "$input"
|
|
}
|
|
|
|
msg()
|
|
{
|
|
local msg="PRIVMSG $1 :"
|
|
shift
|
|
echo -en "${msg}$@\r\n" | tee -a "$input"
|
|
}
|
|
|
|
nick()
|
|
{
|
|
local msg="NICK $1"
|
|
shift
|
|
echo -en "${msg}\r\n" | tee -a "$input"
|
|
}
|
|
|
|
reply()
|
|
{
|
|
shift
|
|
local msg="PRIVMSG $1 :"
|
|
echo -en "${msg}$@\r\n" | tee -a "$input"
|
|
}
|
|
|
|
act()
|
|
{
|
|
local msg="PRIVMSG $1 :\x01ACTION"
|
|
shift
|
|
echo -en "$msg $@\x01\r\n" | tee -a "$input"
|
|
}
|