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

Fix incorrect fact_find in interpreter

This commit is contained in:
Pragmatic Software 2017-08-30 06:54:23 -07:00
parent 3b93d6c281
commit b0b1d1affa

View File

@ -204,7 +204,7 @@ sub interpret {
$tonick = $nick if defined $tonick and $tonick eq 'me'; $tonick = $nick if defined $tonick and $tonick eq 'me';
if ($keyword !~ /^(factrem|forget|factdel|factadd|add|factfind|find|factshow|show|forget|factdel|factset|factchange|change|msg|tell|cc|eval|u|udict|ud|actiontrigger|urban|perl)/) { if ($keyword !~ /^(?:factrem|forget|set|factdel|factadd|add|factfind|find|factshow|show|forget|factdel|factset|factchange|change|msg|tell|cc|eval|u|udict|ud|actiontrigger|urban|perl)$/) {
$keyword =~ s/(\w+)([?!.]+)$/$1/; $keyword =~ s/(\w+)([?!.]+)$/$1/;
$arguments =~ s/(?<![\w\/\-\\])me\b/$nick/gi if defined $arguments && $depth <= 2; $arguments =~ s/(?<![\w\/\-\\])me\b/$nick/gi if defined $arguments && $depth <= 2;
$arguments =~ s/(?<![\w\/\-\\])my\b/${nick}'s/gi if defined $arguments && $depth <= 2; $arguments =~ s/(?<![\w\/\-\\])my\b/${nick}'s/gi if defined $arguments && $depth <= 2;
@ -278,7 +278,7 @@ sub handle_result {
if (defined $command) { if (defined $command) {
my ($cmd, $args) = split / /, $command, 2; my ($cmd, $args) = split / /, $command, 2;
if (not $self->{pbot}->{commands}->exists($cmd)) { if (not $self->{pbot}->{commands}->exists($cmd)) {
my ($chan, $trigger) = $self->{pbot}->{factoids}->find_factoid($from, $cmd, $args, 1, 0, 1); my ($chan, $trigger) = $self->{pbot}->{factoids}->find_factoid($from, $cmd, $args, 1);
if(defined $trigger) { if(defined $trigger) {
if ($preserve_whitespace == 0) { if ($preserve_whitespace == 0) {
$preserve_whitespace = $self->{pbot}->{factoids}->{factoids}->hash->{$chan}->{$trigger}->{preserve_whitespace}; $preserve_whitespace = $self->{pbot}->{factoids}->{factoids}->hash->{$chan}->{$trigger}->{preserve_whitespace};