mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-23 11:12:42 +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;
|
||||
}
|
||||
|
||||
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->{arglist} = $self->{pbot}->{interpreter}->make_args($context->{arguments});
|
||||
}
|
||||
|
@ -416,10 +416,19 @@ sub interpret {
|
||||
# unescape any escaped pipes
|
||||
$arguments =~ s/\\\|\s*\{/| {/g;
|
||||
|
||||
# replace pronouns like "i", "my", etc, with "nick", "nick's", etc
|
||||
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'))
|
||||
my $from = $context->{from};
|
||||
|
||||
$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
|
||||
# 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
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 4320,
|
||||
BUILD_REVISION => 4322,
|
||||
BUILD_DATE => "2021-07-27",
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user