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

Interpreter: minor clean-up

This commit is contained in:
Pragmatic Software 2021-08-23 21:54:07 -07:00
parent 50d4a2a94d
commit a9eb7cc24b
2 changed files with 4 additions and 6 deletions

View File

@ -553,6 +553,9 @@ sub handle_result {
# if passed, allow $result parameter to override contextual result # if passed, allow $result parameter to override contextual result
$result //= $context->{result}; $result //= $context->{result};
# ensure we have a command result to work with
$result //= '';
# preservation of consecutive whitespace is disabled by default # preservation of consecutive whitespace is disabled by default
$context->{preserve_whitespace} //= 0; $context->{preserve_whitespace} //= 0;
@ -564,11 +567,6 @@ sub handle_result {
$self->{pbot}->{logger}->log(Dumper $context); $self->{pbot}->{logger}->log(Dumper $context);
} }
# ensure we have a command result to work with
if (not defined $result or length $result == 0) {
$result = "";
}
# strip and store /command prefixes # strip and store /command prefixes
# to be re-added after result processing # to be re-added after result processing
if ($result =~ s!^(/say|/me|/msg \S+) !!) { if ($result =~ s!^(/say|/me|/msg \S+) !!) {

View File

@ -25,7 +25,7 @@ use PBot::Imports;
# These are set by the /misc/update_version script # These are set by the /misc/update_version script
use constant { use constant {
BUILD_NAME => "PBot", BUILD_NAME => "PBot",
BUILD_REVISION => 4363, BUILD_REVISION => 4364,
BUILD_DATE => "2021-08-23", BUILD_DATE => "2021-08-23",
}; };