commit dc0cf8254d3a05b6940c03fa729729d5d7b7f184
parent 226a18d30068bb5656e736ec939efde93a145eb2
Author: noodle <noodle@pastanoggin.com>
Date: Thu, 26 Jun 2025 14:39:43 +0300
fix regression with HUUUH line and improve regex intelligence
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/mata_bot.pl b/mata_bot.pl
@@ -77,6 +77,9 @@ sub respond_command {
(was)?sup+
)\b{wb}/ix) {
$reply = "Looking for technomage, and you? ${MATA_NORM}"
+ } elsif ($content =~ /\?$/) {
+ # we got a question
+ $reply = "$ball->[rand @$ball] ${MATA_CUTE}"
} elsif ($content =~ /\b{wb}(
goo+d+\s*(bo+[ity]+o*|gir(l+|lie+))|
w(elcome+)?\s*(b+|back+)
@@ -100,13 +103,10 @@ sub respond_command {
yo+
)\b{wb}/ix) {
$reply = "$hellos->[rand @$hellos], ${sender_nick}! ${MATA_HAPPY}"
- } elsif ($content =~ /\?$/) {
- # we got a question
- $reply = "$ball->[rand @$ball] ${MATA_CUTE}"
} elsif ($sender_nick eq $MOTHER) {
$reply = "Done, mother! ${MATA_HAPPY}"
} else {
- $reply = " ${MATA_NORM}\1"
+ $reply = "\1ACTION leans over and places it's hand near it's antenna. \"HUUH?\" ${MATA_NORM}\1";
}
return $reply;
}
@@ -210,7 +210,7 @@ sub respond {
}
# TODO: this part should use [^ ] and .* instead but i'm scared of .*
} elsif ($message =~ /^ *${NICK_RE}[:, ] *([^\000\r\n ][^\000\r\n]*)$/
- or $message =~ /^ *([^\000\r\n ][^\000\r\n]*)[, ] *${NICK_RE}\W*$/) {
+ or $message =~ /^ *([^\000\r\n ][^\000\r\n]*)[, ] *${NICK_RE}[\W\d]*$/) {
$reply = respond_command($lists->{'ball'}, $lists->{'hellos'}, $sender_nick, $1);
} elsif ($message =~ /\b${NICK_RE}\b/) {
$reply = respond_mention($lists->{'quotes'}, $sender_nick, $message);