mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-22 18:52:40 +01:00
Factoids: move /code
to after action processing
This commit is contained in:
parent
3a63448753
commit
646a7f8e7f
@ -257,15 +257,6 @@ sub interpreter($self, $context) {
|
||||
$action = $self->{pbot}->{factoids}->{data}->{storage}->get_data($channel, $keyword, 'action');
|
||||
}
|
||||
|
||||
# action is a code factoid
|
||||
if ($action =~ m{^/code\s+([^\s]+)\s+(.+)$}msi) {
|
||||
my ($lang, $code) = ($1, $2);
|
||||
$context->{lang} = $lang;
|
||||
$context->{code} = $code;
|
||||
$self->{pbot}->{factoids}->{code}->execute($context);
|
||||
return '';
|
||||
}
|
||||
|
||||
# fork factoid if background-process is enabled
|
||||
if ($self->{pbot}->{factoids}->{data}->{storage}->get_data($channel, $keyword, 'background-process')) {
|
||||
my $timeout = $self->{pbot}->{factoids}->{data}->{storage}->get_data($channel, $keyword, 'process-timeout');
|
||||
@ -453,6 +444,16 @@ sub handle_action($self, $context, $action) {
|
||||
$context->{preserve_whitespace} = $preserve_whitespace;
|
||||
}
|
||||
|
||||
# action is a code factoid
|
||||
if ($action =~ m{^/code\s+([^\s]+)\s+(.+)$}msi) {
|
||||
my ($lang, $code) = ($1, $2);
|
||||
$context->{lang} = $lang;
|
||||
$context->{code} = $code;
|
||||
$self->{pbot}->{factoids}->{code}->execute($context);
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
return $action if $context->{special} eq 'code-factoid';
|
||||
|
||||
if ($self->{pbot}->{factoids}->{data}->{storage}->get_data($channel, $keyword, 'type') eq 'applet') {
|
||||
|
@ -25,8 +25,8 @@ use PBot::Imports;
|
||||
# These are set by the /misc/update_version script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 4796,
|
||||
BUILD_DATE => "2024-10-02",
|
||||
BUILD_REVISION => 4798,
|
||||
BUILD_DATE => "2024-10-04",
|
||||
};
|
||||
|
||||
sub initialize {}
|
||||
|
Loading…
Reference in New Issue
Block a user