irc-bot/cobalt-handler

30 lines
652 B
Plaintext
Raw Normal View History

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)
case $command in
001)
printf '\aJOIN #woozle\n'
printf '\aJOIN #foozle\n'
printf '\aJOIN #bot\n'
;;
PRIVMSG)
2010-12-16 21:13:34 -07:00
case "$forum" in
\#woozle|\#foozle)
./firebot "$text" || \
./whuffie woozle.whuffie.cdb "$text" || \
./infobot woozle.factoids.cdb "$text"
;;
esac
2010-12-15 22:36:16 -07:00
;;
INVITE)
printf '\aJOIN %s\n' "$forum"
;;
esac