mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-22 18:52:40 +01:00
Applets: Add $context->{interpreted}
to exit interpreter loop
This commit is contained in:
parent
29f1fa0c4b
commit
1f232a9455
@ -33,10 +33,6 @@ sub execute_applet($self, $context) {
|
||||
}
|
||||
|
||||
$self->{pbot}->{process_manager}->execute_process($context, sub { $self->launch_applet(@_) });
|
||||
|
||||
# return defined empty string to tell Interpreter::interpret() that we've
|
||||
# handled this command so it stops looping through registered interpreters
|
||||
return '';
|
||||
}
|
||||
|
||||
sub launch_applet($self, $context) {
|
||||
|
@ -561,7 +561,7 @@ sub interpret($self, $context) {
|
||||
$result = $func->{subref}->($context);
|
||||
|
||||
# exit loop if interpreter returned output
|
||||
last if defined $result;
|
||||
last if $context->{interpreted} || defined $result;
|
||||
|
||||
# reset any manipulated/overridden arguments
|
||||
$context->{arguments} = $context->{original_arguments};
|
||||
|
@ -89,9 +89,11 @@ sub cmd_date($self, $context) {
|
||||
root_channel => $context->{from},
|
||||
root_keyword => "date_applet",
|
||||
keyword => "date_applet",
|
||||
arguments => "$timezone"
|
||||
arguments => "$timezone",
|
||||
};
|
||||
|
||||
$context->{interpreted} = 1;
|
||||
|
||||
$self->{pbot}->{applets}->execute_applet($newcontext);
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ use PBot::Imports;
|
||||
# These are set by the /misc/update_version script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 4828,
|
||||
BUILD_REVISION => 4830,
|
||||
BUILD_DATE => "2024-11-03",
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user