From 8441869fac4944fc3411fcdcbf99d53bbbeee645 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Mon, 18 Dec 2017 03:51:09 -0800 Subject: [PATCH] Fix embedded command extraction --- PBot/Interpreter.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PBot/Interpreter.pm b/PBot/Interpreter.pm index 536c18a2..31a53529 100644 --- a/PBot/Interpreter.pm +++ b/PBot/Interpreter.pm @@ -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*\}$//;