mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-02 15:34:05 +01:00
Factoids: factoid variables can now be quoted properly
This commit is contained in:
parent
8814fdfe9b
commit
ff3ffea15e
@ -463,13 +463,15 @@ sub expand_factoid_vars {
|
||||
|
||||
if ($self->{factoids}->hash->{$var_chan}->{$var}->{type} eq 'text') {
|
||||
my $change = $self->{factoids}->hash->{$var_chan}->{$var}->{action};
|
||||
my @list = split(/\s|(".*?")/, $change);
|
||||
my @list = $self->{pbot}->{interpreter}->split_line($change);
|
||||
my @mylist;
|
||||
for (my $i = 0; $i <= $#list; $i++) {
|
||||
push @mylist, $list[$i] if defined $list[$i] and length $list[$i];
|
||||
}
|
||||
my $line = int(rand($#mylist + 1));
|
||||
$mylist[$line] =~ s/"//g;
|
||||
if (not $mylist[$line] =~ s/^"(.*)"$/$1/) {
|
||||
$mylist[$line] =~ s/^'(.*)'$/$1/;
|
||||
}
|
||||
|
||||
foreach my $mod (split /:/, $modifier) {
|
||||
given ($mod) {
|
||||
|
Loading…
Reference in New Issue
Block a user