3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-03 01:48:38 +02:00

Add botnick to "Why would I want to do that to myself?" condition

This commit is contained in:
Pragmatic Software 2015-09-19 20:02:11 -07:00
parent 5abf047602
commit 43c0361354

View File

@ -193,11 +193,13 @@ sub interpret {
$arguments =~ s/(?<![\w\/\-])me\b/$nick/gi if defined $arguments && $depth <= 2; $arguments =~ s/(?<![\w\/\-])me\b/$nick/gi if defined $arguments && $depth <= 2;
} }
if(defined $arguments && $arguments =~ m/^(your|him|her|its|it|them|their)(self|selves)$/i) { my $botnick = $self->{pbot}->{registry}->get_value('irc', 'botnick');
if (defined $arguments && ($arguments =~ m/^(your|him|her|its|it|them|their)(self|selves)$/i || $arguments =~ m/^$botnick$/i)) {
my $delay = (rand 10) + 8; my $delay = (rand 10) + 8;
my $message = { my $message = {
nick => $nick, user => $user, host => $host, command => $command, checkflood => 1, nick => $nick, user => $user, host => $host, command => $command, checkflood => 1,
message => "Why would I want to do that to myself?" message => "$nick: Why would I want to do that to myself?"
}; };
$self->add_message_to_output_queue($from, $message, $delay); $self->add_message_to_output_queue($from, $message, $delay);
return undef; return undef;