mirror of
https://github.com/perlbot/perlbuut
synced 2025-06-09 12:35:42 -04:00
fix a bug with help, i need to check $said->{backdressed} everywhere for errors, but i'll do that later
I've also attempted to make the substitution work on factoids, and actually save them. i've also attempted to get geoip to work with the city database, we'll see
This commit is contained in:
parent
47297dd70e
commit
47cc958ccc
3 changed files with 12 additions and 4 deletions
|
@ -387,12 +387,19 @@ sub get_fact_substitute {
|
|||
|
||||
#moving this to its own function for cleanliness
|
||||
$result = $self->_fact_substitute($pred, $match, $subst, $flags);
|
||||
|
||||
# my( $self, $body, $name, $said ) = @_;
|
||||
|
||||
# $body =~ s/^\s*learn\s+//;
|
||||
# my( $subject, $predicate ) = split /\s+as\s+/, $body, 2;
|
||||
|
||||
$self->get_fact_learn("learn $subject as $result");
|
||||
|
||||
return "Result was, [$result]";
|
||||
return "learned $subject as $result";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Can't use dangerous things in a regex, you naughty user you";
|
||||
return "Can't use dangerous things in a regex, you naughty user";
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -4,7 +4,8 @@ no warnings 'void';
|
|||
|
||||
sub {
|
||||
my( $said, $pm ) = @_;
|
||||
my $gi = Geo::IP->open("/home/simcop2387/geoip/GeoLiteCity.dat", GEOIP_STANDARD);
|
||||
$Geo::IP::PP_OPEN_TYPE_PATH = "/home/simcop2387/geoip/";
|
||||
my $gi = Geo::IP->open_type(GEOIP_CITY_EDITION_REV0, GEOIP_STANDARD);
|
||||
|
||||
print "Record for $said->{body}: ";
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ sub {
|
|||
print $plugin->{help_text};
|
||||
}
|
||||
else {
|
||||
print "Sorry, no plugin named $plugin_name found.";
|
||||
print "Sorry, no plugin named $plugin_name found." unless $said->{backdressed};
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Reference in a new issue