mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-20 02:49:49 +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:
parent
5f5cd6ec08
commit
9fa3b865e9
@ -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 {
|
||||
|
@ -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",
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user