+1.5.3
+=====
+
+* New maxVolunteerLength to govern max size of non addressed replies
+
+* Cleaned up some of the regex code for what the bot considers a question
+
+* Fixed an obscure and undocumented variable that was disabling "query?"
+questions in non addressed mode
+
1.5.2
=====
maxListReplyCount 15
maxListReplyLength 400
+md5
- minVolunteerLength 50
+ minVolunteerLength 2
+ maxVolunteerLength 512
+nickometer
+pager
+piglatin
# allow the following only if they have been made on purpose.
if ( $rhs ne '' and $rhs !~ /^</ ) {
- / \Q$ident$/i and last; # someone said i'm something.
+ / \Q$ident\E$/i and last; # someone said i'm something.
/^i('m)? / and last;
/^(it|that|there|what)('s)?(\s+|$)/ and last;
/^you('re)?(\s+|$)/ and last;
$rhs =~ /( \Q$ident\E's|\Q$ident\E's )/i and last; # ownership.
# duplication.
- $rhs =~ /^\Q$lhs /i and last;
+ $rhs =~ /^\Q$lhs\E /i and last;
last if ( $rhs =~ /^is /i and / is$/ );
$valid++;
for ($question) {
# fix the string.
- s/^hey([, ]+)where/where/i;
+ s/^where is //i;
s/\s+\?$/?/;
- s/^whois /who is /i
- ; # Must match ^, else factoids with "whois" anywhere break
- s/where can i find/where is/i;
- s/how about/where is/i;
+ s/^whois //i; # Must match ^, else factoids with "whois" anywhere break
+ s/^who is //i;
+ s/^what is (a|an)?//i;
+ s/^how do i //i;
+ s/^where can i (find|get|download)//i;
+ s/^how about //i;
s/ da / the /ig;
# clear the string of useless words.
local ($query) = @_;
local ($reply) = '';
local $finalQMark = $query =~ s/\?+\s*$//;
- $finalQMark += $query =~ s/\?\s*$//;
$query =~ s/^\s+|\s+$//g;
if ( !defined $query or $query =~ /^\s*$/ ) {
if ( !$addressed ) {
return '' unless ($finalQMark);
- return '' unless &IsChanConf('minVolunteerLength') > 0;
- return '' if ( length $query < &::getChanConf('minVolunteerLength') );
+ return ''
+ if (
+ length $query <
+ &::getChanConfDefault( 'minVolunteerLength', 2, $chan ) or
+ $param{'addressing'} =~ m/require/i );
+ return ''
+ if (
+ length $query >
+ &::getChanConfDefault( 'maxVolunteerLength', 512, $chan ) or
+ $param{'addressing'} =~ m/require/i );
}
else {
### TODO: this should be caught in Process.pl?
if ( $in =~ /(^|\s)(is|are)(\s|$)/i ) {
my ( $lhs, $mhs, $rhs ) = ( $`, $&, $' );
+ # Quit if they are over the limits. Check done here since Core.pl calls
+ # this mid sub and Question.pl needs its own check as well. NOTE: $in is
+ # used in this place since lhs and rhs are really undefined for unwanted
+ # teaching. Mainly, the "is" could be anywhere within a 510 byte or so
+ # block of text, so the total size was choosen since the sole purpose of
+ # this logic is to not hammer the db with pointless factoids that were
+ # only meant to be general conversation.
+ return ''
+ if (
+ length $in <
+ &::getChanConfDefault( 'minVolunteerLength', 2, $chan ) or
+ $param{'addressing'} =~ m/require/i ) and not $addressed;
+ return ''
+ if (
+ length $in >
+ &::getChanConfDefault( 'maxVolunteerLength', 512, $chan ) or
+ $param{'addressing'} =~ m/require/i ) and not $addressed;
+
# allows factoid arguments to be updated. -lear.
$lhs =~ s/^(cmd: )?(.*)/$1||'' . lc $2/e;