From 833c20efbbbf70f189f02d23d4fbde70f173d940 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Fri, 8 Jul 2022 09:11:16 -0700 Subject: [PATCH] Factoids: do not prefix nick if action has $args --- lib/PBot/Core/Factoids/Interpreter.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/PBot/Core/Factoids/Interpreter.pm b/lib/PBot/Core/Factoids/Interpreter.pm index 2342baf4..1c03e520 100644 --- a/lib/PBot/Core/Factoids/Interpreter.pm +++ b/lib/PBot/Core/Factoids/Interpreter.pm @@ -343,11 +343,11 @@ sub handle_action { $context->{arguments} = ''; $context->{original_arguments} = ''; } else { - # set nickprefix if args is a present nick and factoid action doesn't have $nick - if ($self->{pbot}->{factoids}->{data}->{storage}->get_data($channel, $keyword, 'type') eq 'text') { + # set nickprefix if args is a present nick and factoid action doesn't have $nick or $args + if (!$context->{nickprefix_disabled} && $self->{pbot}->{factoids}->{data}->{storage}->get_data($channel, $keyword, 'type') eq 'text') { my $target = $self->{pbot}->{nicklist}->is_present_similar($context->{from}, $context->{arguments}); - if ($target and $action !~ /\$\{?nick\b/) { + if ($target and $action !~ /\$\{?(?:nick|args)\b/) { $context->{nickprefix} = $target unless $context->{nickprefix_forced}; $context->{nickprefix_disabled} = 0; }