mirror of
https://github.com/perlbot/perlbuut
synced 2025-06-08 04:45:41 -04:00
adding, "no, " support
This commit is contained in:
parent
e08e3e3a1c
commit
f60491766a
1 changed files with 3 additions and 4 deletions
|
@ -111,8 +111,7 @@ sub command {
|
||||||
if( !$call_only and $subject =~ /\s+$COPULA_RE\s+/ ) {
|
if( !$call_only and $subject =~ /\s+$COPULA_RE\s+/ ) {
|
||||||
my @ret = $self->store_factoid( $said );
|
my @ret = $self->store_factoid( $said );
|
||||||
|
|
||||||
return( 'handled', "Failed to store $said->{body}" )
|
return( 'handled', "Failed to store $said->{body}" ) unless @ret;
|
||||||
unless @ret;
|
|
||||||
|
|
||||||
return ('handled', "@ret") if ($ret[0] =~ /^insuff/i);
|
return ('handled', "@ret") if ($ret[0] =~ /^insuff/i);
|
||||||
return( 'handled', "Stored @ret" );
|
return( 'handled', "Stored @ret" );
|
||||||
|
@ -178,7 +177,7 @@ sub store_factoid {
|
||||||
my( $self, $said) =@_;
|
my( $self, $said) =@_;
|
||||||
my ($author, $body ) = ($said->{name}, $said->{body});
|
my ($author, $body ) = ($said->{name}, $said->{body});
|
||||||
|
|
||||||
return unless $body =~ /^\s*(.+?)\s+($COPULA_RE)\s+(.+)$/s;
|
return unless $body =~ /^(?:no[, ]?)\s*(.+?)\s+($COPULA_RE)\s+(.+)$/s;
|
||||||
my( $subject, $copula, $predicate ) = ($1,$2,$3);
|
my( $subject, $copula, $predicate ) = ($1,$2,$3);
|
||||||
my $compose_macro = 0;
|
my $compose_macro = 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue