mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-11 12:32:37 +01:00
Fix embedded command extraction
This commit is contained in:
parent
8f0ae852bd
commit
8441869fac
@ -96,6 +96,7 @@ sub process_line {
|
||||
my $cmd_text = $text;
|
||||
$cmd_text =~ s/^\/me\s+//;
|
||||
|
||||
=cut
|
||||
# check for code compiler invocation
|
||||
my $has_code;
|
||||
if ($cmd_text =~ m/^(?:$botnick.?)?\s*{\s*(.+)\s*}\s*$/) {
|
||||
@ -119,6 +120,7 @@ sub process_line {
|
||||
}
|
||||
}
|
||||
}
|
||||
=cut
|
||||
|
||||
# check for bot command invocation
|
||||
my @commands;
|
||||
@ -160,7 +162,7 @@ sub process_line {
|
||||
}
|
||||
|
||||
for (my $count = 0; $count < 3; $count++) {
|
||||
my ($extracted) = extract_codeblock $cmd_text, '{}', "(?s).*?$bot_trigger";
|
||||
my ($extracted) = extract_codeblock $cmd_text, '{}', "(?s).*?$bot_trigger(?=\{)";
|
||||
last if not defined $extracted;
|
||||
$extracted =~ s/^\{\s*//;
|
||||
$extracted =~ s/\s*\}$//;
|
||||
|
Loading…
Reference in New Issue
Block a user