3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-27 13:12:42 +01:00

Factoids now ignore arguments that do not look like a nick if the factoid doesn't take an argument -- fixes factoid triggers on sentences with bot's name; find_factoid searches global channel if $from is not a channel

This commit is contained in:
Pragmatic Software 2010-06-30 04:58:22 +00:00
parent 5f5cd6ec08
commit 9fa3b865e9
2 changed files with 3 additions and 5 deletions

View File

@ -158,7 +158,7 @@ sub export_factoids {
sub find_factoid {
my ($self, $from, $keyword, $arguments, $exact_channel, $exact_trigger) = @_;
$from = '.*' if not defined $from;
$from = '.*' if not defined $from or $from !~ /^#/;
my $string = "$keyword" . (defined $arguments ? " $arguments" : "");
@ -296,9 +296,7 @@ sub interpreter {
$result =~ s/^/\/say $arguments: $keyword is / unless (defined $tonick);
}
} else {
if($result !~ /^\/.+? /) {
$result =~ s/^/\/say $keyword is / unless (defined $tonick);
}
return undef;
}
}
} else {

View File

@ -13,7 +13,7 @@ use warnings;
# These are set automatically by the build/commit script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 219,
BUILD_REVISION => 220,
BUILD_DATE => "2010-06-29",
};