Subject: | Bot Incorrectly think it's being addressed |
Date: | Mon, 19 May 2014 13:44:24 -0500 |
To: | bug-Bot-BasicBot [...] rt.cpan.org |
From: | Meshach Mitchell <meshach.mitchell [...] gmail.com> |
... if it the first word of the message starts of the same as the bot name,
fixed with:
--- /usr/local/share/perl/5.18.2/Bot/BasicBot.pm.old 2014-05-19
13:41:37.641138847 -0500
+++ /usr/local/share/perl/5.18.2/Bot/BasicBot.pm 2014-05-19
13:39:24.449124240 -0500
@@ -666,13 +666,13 @@
if ($mess->{channel} ne "msg") {
my $own_nick = $self->nick;
- if ($mess->{body} =~ s/^(\Q$own_nick\E)\s*[:,-]?\s*//i) {
+ if ($mess->{body} =~ s/^(\Q$own_nick\E)\b\s*[:,-]?\s*//i) {
$mess->{address} = $1;
}
for my $alt_nick ($self->alt_nicks) {
last if $mess->{address};
- if ($mess->{body} =~ s/^(\Q$alt_nick\E)\s*[:,-]?\s*//i) {
+ if ($mess->{body} =~ s/^(\Q$alt_nick\E)\b\s*[:,-]?\s*//i) {
$mess->{address} = $1;
}
}
-- Meshach Mitchell