2010-12-15 22:36:16 -07:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
sender=$1; export sender; shift
|
|
|
|
forum=$1; export forum; shift
|
|
|
|
prefix=$1; export prefix; shift
|
|
|
|
command=$1; export command; shift
|
|
|
|
# $* is now args
|
|
|
|
text=$(cat)
|
|
|
|
|
2010-12-16 21:29:52 -07:00
|
|
|
join () {
|
|
|
|
printf '\aJOIN %s\n' "$1"
|
|
|
|
}
|
|
|
|
|
2010-12-15 22:36:16 -07:00
|
|
|
case $command in
|
|
|
|
001)
|
2010-12-16 21:29:52 -07:00
|
|
|
join "#woozle"
|
|
|
|
join "#foozle"
|
|
|
|
join "#bot"
|
2010-12-15 22:36:16 -07:00
|
|
|
;;
|
|
|
|
PRIVMSG)
|
2010-12-16 21:13:34 -07:00
|
|
|
case "$forum" in
|
2010-12-16 21:29:52 -07:00
|
|
|
\#*)
|
2010-12-16 21:13:34 -07:00
|
|
|
./firebot "$text" || \
|
|
|
|
./whuffie woozle.whuffie.cdb "$text" || \
|
|
|
|
./infobot woozle.factoids.cdb "$text"
|
|
|
|
;;
|
|
|
|
esac
|
2010-12-15 22:36:16 -07:00
|
|
|
;;
|
|
|
|
INVITE)
|
2010-12-16 21:29:52 -07:00
|
|
|
join "$forum"
|
|
|
|
echo "Thanks for the invitation, $sender."
|
2010-12-15 22:36:16 -07:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|