diff --git a/NEWS b/NEWS index 7e8fc3a..afabf71 100644 --- a/NEWS +++ b/NEWS @@ -15,7 +15,8 @@ In this alpha5 release, we have added: * LinkTitle module for returning the page title of links sent to a channel. * Added core command MODLIST. -* Added SEARCH and MORE to QDB. +* Added SEARCH and MORE to QDB. Amount of results returned at a time with + qdb_search_resnum in the config. Bug fixes: diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 1185b83..ed53d88 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -3,6 +3,8 @@ Auto IRC Bot 3.0: Change Log 3.0 Indev =============================================================================== + * You can now define how many results are returned by QDB SEARCH/MORE at a + time with qdb_search_resnum in the config. * Added SEARCH and MORE to QDB. * Killed EMODS in the starter script and updated MODS * Added core command MODLIST. diff --git a/modules/EightBall.pm b/modules/EightBall.pm index eaaf8f1..c201e36 100644 --- a/modules/EightBall.pm +++ b/modules/EightBall.pm @@ -13,7 +13,7 @@ our $ANSWER = 0; sub _init { # Create the 8BALL and RIGBALL commands. - cmd_add('8BALL', 0, 0, \%M::EightBall::HELP_8BALL, \&M::EightBall::c_8ball) or return 0; + cmd_add('8BALL', 3, 0, \%M::EightBall::HELP_8BALL, \&M::EightBall::c_8ball) or return 0; cmd_add('RIGBALL', 1, 'cmd.rigball', \%M::EightBall::HELP_RIGBALL, \&M::EightBall::rigball) or return 0; # Success. diff --git a/modules/LinkTitle.pm b/modules/LinkTitle.pm index 688e604..2a990f3 100644 --- a/modules/LinkTitle.pm +++ b/modules/LinkTitle.pm @@ -4,7 +4,7 @@ package M::LinkTitle; use strict; use warnings; -use LWP::UserAgent; +#use LWP::UserAgent; use HTML::Entities; use API::Std qw(hook_add hook_del); use API::IRC qw(privmsg); @@ -40,6 +40,7 @@ sub gettitle # We've got a match, connect to the server. my $srv = $1; # Create an instance of LWP::UserAgent. + require LWP::UserAgent; my $ua = LWP::UserAgent->new(); $ua->agent('Auto IRC Bot'); $ua->timeout(3); @@ -59,6 +60,7 @@ sub gettitle privmsg($src->{svr}, $chan, "\2Title:\2 $title"); } } + Class::Unload->unload('LWP::UserAgent'); } } diff --git a/modules/QDB.pm b/modules/QDB.pm index add3b72..4971a96 100644 --- a/modules/QDB.pm +++ b/modules/QDB.pm @@ -5,7 +5,7 @@ package M::QDB; use strict; use warnings; use feature qw(switch); -use API::Std qw(cmd_add cmd_del trans has_priv match_user); +use API::Std qw(cmd_add cmd_del trans has_priv conf_get match_user); use API::IRC qw(privmsg notice); our @BUFFER; @@ -151,9 +151,11 @@ sub cmd_qdb } # Return four quotes. - privmsg($src->{svr}, $src->{chan}, "Results for \2$expr\2:"); + privmsg($src->{svr}, $src->{chan}, "\2$#BUFFER\2 results for \2$expr\2:"); my $i = 0; - while ($i <= 3) { + my $si = 3; + if (conf_get('qdb_search_resnum')) { $si = (conf_get('qdb_search_resnum'))[0][0] - 1; } + while ($i <= $si) { if (!defined $BUFFER[0]) { last; } @@ -171,7 +173,9 @@ sub cmd_qdb # Return four quotes. my $i = 0; - while ($i <= 3) { + my $si = 3; + if (conf_get('qdb_search_resnum')) { $si = (conf_get('qdb_search_resnum'))[0][0] - 1; } + while ($i <= $si) { if (!defined $BUFFER[0]) { last; }