stormbot/functions.sh
2020-08-18 21:02:12 -04:00

34 lines
541 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"
}