diff --git a/PBot/Factoids.pm b/PBot/Factoids.pm index 7037aff6..e04e6a09 100644 --- a/PBot/Factoids.pm +++ b/PBot/Factoids.pm @@ -482,7 +482,11 @@ sub expand_factoid_vars { $fixed_a = ucfirst $fixed_a if $a =~ m/^A/; $action =~ s/$a\$$v$modifier/$fixed_a $mylist[$line]/; } else { - $action =~ s/\$$v$modifier/$mylist[$line]/; + if (not length $mylist[$line]) { + $action =~ s/\s+\$$v$modifier//; + } else { + $action =~ s/\$$v$modifier/$mylist[$line]/; + } } } }