From 616fe2c0623c7f0a6f24dc491432f615cf699954 Mon Sep 17 00:00:00 2001
From: Alexandre Morignot <erdnaxeli@gmail.com>
Date: Sun, 17 Aug 2014 00:09:27 +0200
Subject: [PATCH] !later works as expected in query

---
 PlayBot.pl | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/PlayBot.pl b/PlayBot.pl
index 8aa93af..880e20d 100755
--- a/PlayBot.pl
+++ b/PlayBot.pl
@@ -119,6 +119,14 @@ sub later
 		$irc->yield(privmsg => $nick => '['.$id.'] '.$donnees[2].' | '.$donnees[1]);
 		$irc->yield(privmsg => $nick => $donnees[0]);
     
+        # save the content in the history
+        my $sth2 = $dbh->prepare_cached('
+            INSERT INTO playbot_chan (content, chan, sender_irc)
+            VALUES (?,?,?)');
+        $log->error("Couldn't prepare querie; aborting") unless (defined $sth2);
+        $sth2->execute($id, $nick, $nick)
+            or $log->error("Couldn't finish transaction: " . $dbh->errstr);
+
 	    $lastID{$nick} = $id;
 	}
 }
-- 
GitLab