3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-02 18:19:33 +01:00

Fix minor issue with command piping; misc clean-ups

This commit is contained in:
Pragmatic Software 2021-09-04 20:53:02 -07:00
parent 5f2d6d3b96
commit 169a4c9fc7
5 changed files with 9 additions and 11 deletions

View File

@ -440,10 +440,10 @@ sub handle_action {
my $result = $self->{pbot}->{modules}->execute_module($context);
if (length $result) {
if (defined $result && length $result) {
return $ref_from . $result;
} else {
return '';
return $result;
}
}
elsif ($self->{pbot}->{factoids}->{data}->{storage}->get_data($channel, $keyword, 'type') eq 'text') {

View File

@ -554,7 +554,7 @@ sub handle_result {
$result //= $context->{result};
# ensure we have a command result to work with
$result //= '';
return if not defined $result;
# preservation of consecutive whitespace is disabled by default
$context->{preserve_whitespace} //= 0;
@ -1000,9 +1000,8 @@ sub add_to_command_queue {
$context->{'cap-override'} = $command->{'cap-override'};
}
my $result = $self->interpret($context);
$context->{result} = $result;
$self->handle_result($context, $result);
$context->{result} = $self->interpret($context);
$self->handle_result($context);
},
$delay, "command $channel $command->{command}", $repeating
);

View File

@ -23,7 +23,6 @@ sub initialize {
sub execute_module {
my ($self, $context) = @_;
my $text;
if ($self->{pbot}->{registry}->get_value('general', 'debugcontext')) {
use Data::Dumper;

View File

@ -143,8 +143,8 @@ sub execute_process {
# add reader handler
$self->{pbot}->{select_handler}->add_reader($reader, sub { $self->process_pipe_reader($context->{pid}, @_) });
# return empty string since reader will handle the output when child is finished
return '';
# return undef since reader will handle the output when child is finished
return undef;
}
}

View File

@ -25,8 +25,8 @@ use PBot::Imports;
# These are set by the /misc/update_version script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 4374,
BUILD_DATE => "2021-08-28",
BUILD_REVISION => 4376,
BUILD_DATE => "2021-09-04",
};
sub initialize {}