3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-04 18:38:47 +02:00

Factoids: add require_explicit_args metadata to prevent $args from appending undesirably in aliases

This commit is contained in:
Pragmatic Software 2019-05-13 08:37:36 -07:00
parent b838a08f8d
commit bebddb5ea9

View File

@ -1004,7 +1004,9 @@ sub handle_action {
# Check if it's an alias
if ($action =~ /^\/call\s+(.*)$/) {
my $command = $1;
$command .= " $stuff->{original_arguments}" if length $stuff->{original_arguments} and not $stuff->{aliased} and not $stuff->{special} eq 'code-factoid';
unless ($self->{factoids}->hash->{$channel}->{$keyword}->{'require_explicit_args'}) {
$command .= " $stuff->{original_arguments}" if length $stuff->{original_arguments} and not $stuff->{aliased} and not $stuff->{special} eq 'code-factoid';
}
if ($command =~ s/\s*--keyword-override=([^ ]+)\s*//) {
$stuff->{keyword_override} = $1;