commit - 598064f27b382118202c70ac3dde81856ae5f6b2
commit + 3f948ae7aa2915c2dcb6a69adf9c15ded9c31f86
blob - 62f987a8ba9826ff3d05ba8bfb4f3a15ab6dec25
blob + edb8128e08eb00e4ce23892872234fbf66dccc76
--- mata_bot.pl
+++ mata_bot.pl
my $SHAREDIR = '/usr/local/share';
my $CHUNK_LENGTH = 1024;
my $NICK = 'mata_bot';
+my $NICK_RE = qr/mata_?bo[ity]/i;
my $USER = 'mata_bot_beta4';
my $REAL = 'death to technomage!!';
my $MOTHER = 'noodle';
my ($sock, $sender_nick, $message) = @_;
if ($sender_nick eq $MOTHER) {
msg($sock, "Yes, mother? ${MATA_HAPPY}");
- } elsif ($message =~ /^\W*${NICK}\W*$/) {
+ } elsif ($message =~ /^\b${NICK_RE}\b$/) {
msg($sock, "${MATA_NORM} ?");
} else {
msg($sock, "$quotes[int rand($quotes_num)] ${MATA_NORM}");
} else {
msg($sock, "No title found (GET ${url} ${MATA_DEAD}");
}
- } elsif ($message =~ /^ *${NICK}[:, ] *([^\000\r\n ][^\000\r\n]*)$/
- or $message =~ /^ *([^\000\r\n ][^\000\r\n]*)[, ] *${NICK}\W*$/) {
+ } elsif ($message =~ /^ *${NICK_RE}[:, ] *([^\000\r\n ][^\000\r\n]*)$/
+ or $message =~ /^ *([^\000\r\n ][^\000\r\n]*)[, ] *${NICK_RE}\W*$/) {
respond_command($sock, $sender_nick, $1);
- } elsif ($message =~ /\b${NICK}\b/) {
+ } elsif ($message =~ /\b${NICK_RE}\b/) {
respond_mention($sock, $sender_nick, $message);
}
return 0;
blob - 7b3897ac747c1b2e1ef3788f0fe8da2446ae5cdf
blob + 0aef1a7214738afaee2a1a4947a2bb578193f694
--- matabot.8
+++ matabot.8
He's a dungeon master too!!
.It mata_bot: *pray*
Stay prayed up!!
-.It mata_bot I LOVE U!!!
+.It MATABOT I LOVE U!!!
Love the boy.
.It thank you mata_bot!!
Thank your future master.
-.It mata_bot: Who's the good boy?? (or boi, girl, bot, etc.).
+.It mata_boi: Who's the good boy?? (or boi, girl, bot, etc.).
Praise your future master.
-.It ...mata_bot...
+.It .../mata_?bo[ity]/i...
Mention him! This boy talks back!?
.It mata_bot, hru?
Ask him how he's doin.
Ask him what he's up to.
.It mata_bot, good boy! (or boi, girl, bot, etc.).
Praise your future master.
-.It hi, mata_bot!
+.It hi, mata_boy!
Say hi to the boy
.It mata_bot, What doth life?
Ask him your burning questions...