3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-26 20:52:37 +01:00

Plugins/Plang: Output final String value as string literal

This commit is contained in:
Pragmatic Software 2020-07-25 16:09:20 -07:00
parent 29d7582be7
commit 7441f42967

View File

@ -82,7 +82,13 @@ sub cmd_plang {
my $result = $self->{plang}->interpret_string($context->{arguments});
# check to see if we need to append final result to output
$self->{output} .= $self->{plang}->{interpreter}->output_value($result) if defined $result->[1];
if (defined $result->[1]) {
if ($result->[0] eq 'STRING') {
$self->{output} .= $self->{plang}->{interpreter}->output_string_literal($result->[1]);
} else {
$self->{output} .= $self->{plang}->{interpreter}->output_value($result);
}
}
# return the output
return length $self->{output} ? $self->{output} : "No output.";