mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-11 04:22:35 +01:00
Fix rare case where dont-replace-pronouns
was ignored
This commit is contained in:
parent
44a614b716
commit
62a477b7c4
@ -173,7 +173,7 @@ sub interpreter {
|
|||||||
$context->{add_nick} = 1;
|
$context->{add_nick} = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
unless ($self->get_meta($keyword, 'dont-replace-pronouns')) {
|
unless ($context->{'dont-replace-pronouns'}) {
|
||||||
$context->{arguments} = $self->{pbot}->{factoids}->{variables}->expand_factoid_vars($context, $context->{arguments});
|
$context->{arguments} = $self->{pbot}->{factoids}->{variables}->expand_factoid_vars($context, $context->{arguments});
|
||||||
$context->{arglist} = $self->{pbot}->{interpreter}->make_args($context->{arguments});
|
$context->{arglist} = $self->{pbot}->{interpreter}->make_args($context->{arguments});
|
||||||
}
|
}
|
||||||
|
@ -416,10 +416,19 @@ sub interpret {
|
|||||||
# unescape any escaped pipes
|
# unescape any escaped pipes
|
||||||
$arguments =~ s/\\\|\s*\{/| {/g;
|
$arguments =~ s/\\\|\s*\{/| {/g;
|
||||||
|
|
||||||
# replace pronouns like "i", "my", etc, with "nick", "nick's", etc
|
my $from = $context->{from};
|
||||||
if (not $self->{pbot}->{commands}->get_meta($keyword, 'dont-replace-pronouns')
|
|
||||||
and not $self->{pbot}->{factoids}->{data}->get_meta($context->{from}, $keyword, 'dont-replace-pronouns'))
|
$from = '.*' unless $from =~ /^#/;
|
||||||
|
|
||||||
|
if ($self->{pbot}->{commands}->get_meta($keyword, 'dont-replace-pronouns')
|
||||||
|
or $self->{pbot}->{factoids}->{data}->get_meta($from, $keyword, 'dont-replace-pronouns'))
|
||||||
{
|
{
|
||||||
|
$context->{'dont-replace-pronouns'} = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
# replace pronouns like "i", "my", etc, with "nick", "nick's", etc
|
||||||
|
if (not $context->{'dont-replace-pronouns'}) {
|
||||||
|
$self->{pbot}->{logger}->log("Replacing pronouns for $context->{from}.$keyword\n");
|
||||||
|
|
||||||
# if command recipient is "me" then replace it with invoker's nick
|
# if command recipient is "me" then replace it with invoker's nick
|
||||||
# e.g., "!tell me about date" or "!give me date", etc
|
# e.g., "!tell me about date" or "!give me date", etc
|
||||||
|
@ -25,7 +25,7 @@ use PBot::Imports;
|
|||||||
# These are set by the /misc/update_version script
|
# These are set by the /misc/update_version script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 4320,
|
BUILD_REVISION => 4322,
|
||||||
BUILD_DATE => "2021-07-27",
|
BUILD_DATE => "2021-07-27",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user