From 4d2bead3813e9f8d19fdb89cd487395393ebf86f Mon Sep 17 00:00:00 2001 From: Ryan Voots Date: Tue, 9 Aug 2016 14:41:03 -0400 Subject: [PATCH] Make the tell factoid special --- plugins/factoids.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/factoids.pm b/plugins/factoids.pm index fc5c40d..8e8ad88 100644 --- a/plugins/factoids.pm +++ b/plugins/factoids.pm @@ -580,6 +580,7 @@ sub _db_get_fact { sub basic_get_fact { my( $self, $pm, $said, $subject, $name, $call_only ) = @_; + # open(my $fh, ">>/tmp/facts"); my ($fact, $key, $arg); $key = _clean_subject($subject); @@ -605,7 +606,13 @@ sub basic_get_fact { local $said->{body} = $fact->{predicate}; local $said->{addressed} = 1; # Force addressed to circumvent restrictions? May not be needed! - return $plugin->command($said,$pm); + my $ret = $plugin->command($said, $pm); +# use Data::Dumper; +# print $fh Dumper({key => $key, arg => $arg, fact => $fact, ret => $ret, wa => wantarray}); + + $ret = "\x00$ret" if ($key eq "tell"); + + return $ret; } else { return "$fact->{predicate}";