mirror of
https://github.com/pragma-/pbot.git
synced 2025-10-12 22:17:24 +02:00
Pipes can now be escaped for easy factadding, etc
This commit is contained in:
parent
78a12b3a46
commit
1222436616
@ -252,8 +252,9 @@ sub interpret {
|
|||||||
|
|
||||||
my $got_pipe = 0;
|
my $got_pipe = 0;
|
||||||
|
|
||||||
if (defined $arguments && $arguments =~ m/\|\s*\{\s*[^}]+\}\s*$/) {
|
# parse out a pipe unless escaped
|
||||||
$arguments =~ m/(.*?)\s*\|\s*\{\s*([^}]+)\}(.*)/;
|
if (defined $arguments && $arguments =~ m/(?<!\\)\|\s*\{\s*[^}]+\}\s*$/) {
|
||||||
|
$arguments =~ m/(.*?)\s*(?<!\\)\|\s*\{\s*([^}]+)\}(.*)/;
|
||||||
my ($args, $pipe, $rest) = ($1, $2, $3);
|
my ($args, $pipe, $rest) = ($1, $2, $3);
|
||||||
$pipe =~ s/\s+$//;
|
$pipe =~ s/\s+$//;
|
||||||
|
|
||||||
@ -267,6 +268,9 @@ sub interpret {
|
|||||||
$got_pipe = 1;
|
$got_pipe = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# unescape any escaped pipes
|
||||||
|
$arguments =~ s/\\\|\s*\{/| {/g if defined $arguments;
|
||||||
|
|
||||||
$stuff->{nickoverride} = $stuff->{nick} if defined $stuff->{nickoverride} and lc $stuff->{nickoverride} eq 'me';
|
$stuff->{nickoverride} = $stuff->{nick} if defined $stuff->{nickoverride} and lc $stuff->{nickoverride} eq 'me';
|
||||||
|
|
||||||
if ((not exists $stuff->{pipe}) and $keyword !~ /^(?:factrem|forget|set|factdel|factadd|add|factfind|find|factshow|show|forget|factdel|factset|factchange|change|msg|tell|cc|eval|u|udict|ud|actiontrigger|urban|perl)$/) {
|
if ((not exists $stuff->{pipe}) and $keyword !~ /^(?:factrem|forget|set|factdel|factadd|add|factfind|find|factshow|show|forget|factdel|factset|factchange|change|msg|tell|cc|eval|u|udict|ud|actiontrigger|urban|perl)$/) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user