Look for module in global channel before falling back to local channel

This commit is contained in:
Pragmatic Software 2015-10-25 04:01:45 -07:00
parent 4f875f9c4c
commit aa749860c0
2 changed files with 2 additions and 3 deletions

View File

@ -44,8 +44,7 @@ sub execute_module {
$arguments = "" if not defined $arguments;
my @factoids = $self->{pbot}->{factoids}->find_factoid($from, $keyword);
my @factoids = $self->{pbot}->{factoids}->find_factoid($from, $keyword, undef, 2, 2);
if(not @factoids or not $factoids[0]) {
$self->{pbot}->{interpreter}->handle_result($from, $nick, $user, $host, $command, "$keyword $arguments", "/msg $nick Failed to find module for '$keyword' in channel $from\n", 1, 0);

View File

@ -291,7 +291,7 @@ sub find_factoid {
goto NEXT_DEPTH;
}
if ($exact_channel == 1) {
if (defined $exact_channel && $exact_channel == 1) {
return ($channel, $trigger);
} else {
push @results, [$channel, $trigger];