add example bot

This commit is contained in:
Neale Pickett 2012-05-14 14:45:08 -05:00
parent 95a18f7700
commit 962537e98f
3 changed files with 39 additions and 0 deletions

37
newmont/handler Executable file
View File

@ -0,0 +1,37 @@
#! /bin/sh
prefix=$1; export prefix; shift
command=$1; export command; shift
sender=$1; export sender; shift
forum=$1; export forum; shift
text=$1; export text; shift
# $* is now args
# Debug output
echo '>>>' ${prefix:+:}$prefix $command "$@" ${text:+:}"$text" 1>&2
newmont () {
case $text in
*strawberry*)
echo "mmmmm"
;;
esac
}
case $command in
001)
printf "\007JOIN %s\n" "#dumont"
;;
PRIVMSG)
[ $forum = "#dumont" ] && newmont
;;
esac | while read -r line; do
case "$line" in
*)
printf "%s\r\n" "${line#}"
;;
*)
printf "PRIVMSG %s :%s\r\n" "$forum" "$line"
;;
esac
done

1
newmont/nickname Normal file
View File

@ -0,0 +1 @@
newmont

1
newmont/server Normal file
View File

@ -0,0 +1 @@
moo.slashnet.org:6667