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
1 changed files with 4 additions and 2 deletions

View File

@ -193,11 +193,13 @@ sub interpret {
$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 $message = {
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);
return undef;