mirror of
https://github.com/perlbot/perlbuut
synced 2025-06-07 20:55:39 -04:00
Fix sentinal value from plugin
This commit is contained in:
parent
c0205f77a1
commit
b8e7c03210
1 changed files with 10 additions and 6 deletions
|
@ -25,7 +25,7 @@ sub new {
|
||||||
|
|
||||||
my @perl_aliases = map {("eval$_", "weval$_", "seval$_", "wseval$_", "sweval$_")} @versions;
|
my @perl_aliases = map {("eval$_", "weval$_", "seval$_", "wseval$_", "sweval$_")} @versions;
|
||||||
|
|
||||||
$self->{aliases} = [ qw/jseval jeval phpeval pleval perleval deparse swdeparse wsdeparse wdeparse sdeparse k20eval rbeval pyeval luaeval/, @perl_aliases ];
|
$self->{aliases} = [ qw/jseval jeval phpeval pleval perleval deparse swdeparse wsdeparse wdeparse sdeparse k20eval rbeval pyeval luaeval cpeval wscpeval swcpeval wcpeval scpeval/, @perl_aliases ];
|
||||||
$self->{dbh} = DBI->connect("dbi:SQLite:dbname=var/evallogs.db");
|
$self->{dbh} = DBI->connect("dbi:SQLite:dbname=var/evallogs.db");
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
|
@ -102,9 +102,13 @@ sub command {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!$said->{captured} && $resultstr !~ /\S/) {
|
$resultstr =~ s/^(\x00)+//g;
|
||||||
|
|
||||||
|
if (!$said->{captured} && length($resultstr) == 0) {
|
||||||
$resultstr = "No output.";
|
$resultstr = "No output.";
|
||||||
}
|
} elsif (!$said->{captured} && $resultstr !~ /\S/) {
|
||||||
|
$resultstr = "\x{FEFF}$resultstr";
|
||||||
|
}
|
||||||
|
|
||||||
if ($type eq 'perl') {
|
if ($type eq 'perl') {
|
||||||
$self->{dbh}->do("INSERT INTO evals (input, output) VALUES (?, ?)", {}, $code, $resultstr);
|
$self->{dbh}->do("INSERT INTO evals (input, output) VALUES (?, ?)", {}, $code, $resultstr);
|
||||||
|
@ -149,9 +153,9 @@ sub command {
|
||||||
"St. Patricks Day" => {prob => 0.00, chars => []},
|
"St. Patricks Day" => {prob => 0.00, chars => []},
|
||||||
"Super Bowl Sunday" => {prob => 0.00, chars => []},
|
"Super Bowl Sunday" => {prob => 0.00, chars => []},
|
||||||
"Susan B. Anthony Day" => {prob => 0.00, chars => []},
|
"Susan B. Anthony Day" => {prob => 0.00, chars => []},
|
||||||
"Thanksgiving" => {prob => 0.00, chars => []},
|
"Thanksgiving" => {prob => 1.00, chars => ["\x{1F983}"]},
|
||||||
"Thanksgiving Day" => {prob => 0.00, chars => []},
|
"Thanksgiving Day" => {prob => 1.00, chars => ["\x{1F983}"]},
|
||||||
"Valentines Day" => {prob => 0.00, chars => []},
|
"Valentines Day" => {prob => 0.25, chars => ["\x{1F491}"]},
|
||||||
"Veterans Day" => {prob => 0.00, chars => []},
|
"Veterans Day" => {prob => 0.00, chars => []},
|
||||||
"Washingtons Birthday" => {prob => 0.00, chars => []},
|
"Washingtons Birthday" => {prob => 0.00, chars => []},
|
||||||
"Washingtons Birthday (observed)" => {prob => 0.00, chars => []},
|
"Washingtons Birthday (observed)" => {prob => 0.00, chars => []},
|
||||||
|
|
Loading…
Add table
Reference in a new issue