irc-bot/notes

23 lines
412 B
Plaintext
Raw Normal View History

2010-12-16 22:02:43 -07:00
#! /bin/sh
db=$1; shift
text=$1
if [ -f $db/$sender ]; then
echo "Welcome back, $sender. Your messages:"
cat $db/$sender
rm $db/$sender
fi
case "$text" in
.note\ *)
args=${text#.note }
who=${args%% *}
what=${args#* }
when=$(date)
2010-12-16 22:07:39 -07:00
echo "($when) <$prefix> $what" >> $db/$who
2010-12-16 22:02:43 -07:00
echo "Okay, $sender, I've left $who a note."
;;
esac