stormbot/functions.sh

34 lines
541 B
Bash
Raw Normal View History

#!/bin/bash
2020-08-17 21:20:12 -04:00
if [[ -z "$input" ]]; then
input="$(mktemp .XXXXXX)"
fi
2020-08-17 21:20:12 -04:00
close_bot() {
echo -en "QUIT :${quitMessage}\r\n" >> "$input"
}
msg() {
local msg="PRIVMSG $1 :"
shift
2020-08-18 21:02:12 -04:00
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 :"
2020-08-18 21:02:12 -04:00
echo -en "${msg}${*}\r\n" | tee -a "$input"
}
act() {
local msg="PRIVMSG $1 :\x01ACTION"
shift
2020-08-18 21:02:12 -04:00
echo -en "$msg ${*}\x01\r\n" | tee -a "$input"
2016-09-04 12:43:22 -04:00
}