From 6f57e480f39e44be09ae0ed94c6627f1bc0906fd Mon Sep 17 00:00:00 2001 From: Ryan Voots Date: Sat, 31 Oct 2020 01:52:42 -0400 Subject: [PATCH] some updates --- lib/Bot/BB3/PluginManager.pm | 1 - lib/Bot/BB3/Roles/Evalpastebin.pm | 2 +- plugins/{define.pm => define.pm.disabled} | 0 plugins/factoids.pm | 1 - plugins/perldoc.pm | 14 +++++++------- plugins/supereval.pm | 1 + 6 files changed, 9 insertions(+), 10 deletions(-) rename plugins/{define.pm => define.pm.disabled} (100%) diff --git a/lib/Bot/BB3/PluginManager.pm b/lib/Bot/BB3/PluginManager.pm index 2ba9bf1..90ece25 100644 --- a/lib/Bot/BB3/PluginManager.pm +++ b/lib/Bot/BB3/PluginManager.pm @@ -7,7 +7,6 @@ use Data::Dumper; use Text::Glob qw/match_glob/; use Memoize; use Regexp::Assemble; -use JSON::MaybeXS qw//; use strict; sub new { diff --git a/lib/Bot/BB3/Roles/Evalpastebin.pm b/lib/Bot/BB3/Roles/Evalpastebin.pm index 0b0fd2a..7a2d692 100644 --- a/lib/Bot/BB3/Roles/Evalpastebin.pm +++ b/lib/Bot/BB3/Roles/Evalpastebin.pm @@ -50,7 +50,7 @@ sub _start { # TODO setup TCP server. $self->{server} = POE::Component::Server::TCP->new( Port => 1784, - Address =>'192.168.196.2', + Address =>'192.168.32.1', ClientFilter => "POE::Filter::Line", ClientInput => \&receive_paste, ); diff --git a/plugins/define.pm b/plugins/define.pm.disabled similarity index 100% rename from plugins/define.pm rename to plugins/define.pm.disabled diff --git a/plugins/factoids.pm b/plugins/factoids.pm index 9bc8d06..65a1e09 100644 --- a/plugins/factoids.pm +++ b/plugins/factoids.pm @@ -747,7 +747,6 @@ sub get_fact_grep ($self, $body, $name, $said) { my $value_only = $body =~ s/\s*--val\s+//; - #XXX: need to also search contents of factoids TODO $results = $self->dbh->selectall_arrayref(" WITH RECURSIVE factoid_lookup_order_inner (depth, namespace, server, alias_namespace, alias_server, parent_namespace, parent_server, recursive, gen_server, gen_namespace) AS ( SELECT 0 AS depth, namespace, server, alias_namespace, alias_server, parent_namespace, parent_server, recursive, generated_server, generated_namespace diff --git a/plugins/perldoc.pm b/plugins/perldoc.pm index 9972aa4..387d74f 100644 --- a/plugins/perldoc.pm +++ b/plugins/perldoc.pm @@ -60,9 +60,9 @@ sub command { $query =~ s/%20/+/g; if ($oper eq 'q') { - $url = "https://perldoc.pl/search?no_redirect=1&q=".$query."#FAQ"; + $url = "https://perldoc.perl.org/search?no_redirect=1&q=".$query."#FAQ"; } else { - $url = "https://perldoc.pl/search?q=".$query; + $url = "https://perldoc.perl.org/search?q=".$query; } # $url = makeashorterlink($url); } @@ -76,19 +76,19 @@ sub command { $func = "-X" if ($func eq "-x"); #only case where it isn't lowercase, its easier to test at this point - $url = "https://perldoc.pl/functions/".$func + $url = "https://perldoc.perl.org/functions/".$func } elsif ($said->{body} =~ /-v\s+(\S+)\s*/i) #functions, only use the first part of a multiword expression { my $var = uri_encode($1, {"encode_reserved" => 1}); - $url = "https://perldoc.pl/variables/".$var + $url = "https://perldoc.perl.org/variables/".$var } elsif ($said->{body} =~ /-m\s+(\S+)\s*/i) # got a module! {#http://search.cpan.org/search?query=foo%3ABar&mode=all my $query = uri_encode($1); # $query =~ s/%20/+/g; - $url = "https://perldoc.pl/".$query; + $url = "https://perldoc.perl.org/".$query; # $url = makeashorterlink($url); } elsif ($said->{body} =~ /::/) #module, go to cpan also @@ -97,14 +97,14 @@ sub command { $trimmed =~ s/^\s*(\S+)\s*(?:#.*)?$/$1/; my $query = uri_encode($trimmed); $query =~ s/%20/+/g; - $url = "https://perldoc.pl/$query"; + $url = "https://perldoc.perl.org/$query"; # $url = makeashorterlink($url); } else # we've got just a plain word, use it as a doc title { #http://perldoc.perl.org/perlrun.html if ($said->{body} =~ /^\s*(\S+)\s*(?:#.*)?$/) { - $url = "https://perldoc.pl/$1"; + $url = "https://perldoc.perl.org/$1"; } else { diff --git a/plugins/supereval.pm b/plugins/supereval.pm index 1eb0933..a7137c9 100644 --- a/plugins/supereval.pm +++ b/plugins/supereval.pm @@ -14,6 +14,7 @@ use Regexp::Optimizer; use Regexp::Assemble; use strict; use utf8; +use DBI; no warnings 'void';