From a086f2bc6eca2a4448ee971c85061cf3e8d5134f Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Sat, 1 Jun 2013 15:00:57 -0400 Subject: [PATCH] Fixing remember plugin --- plugins/remember.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/remember.go b/plugins/remember.go index 04ab5c8..228c236 100644 --- a/plugins/remember.go +++ b/plugins/remember.go @@ -5,6 +5,7 @@ import ( "github.com/chrissexton/alepale/bot" "labix.org/v2/mgo" "labix.org/v2/mgo/bson" + "log" "math/rand" "strings" "time" @@ -86,6 +87,7 @@ func (p *RememberPlugin) Message(message bot.Message) bool { id := int(funcres["retval"].(float64)) fact := Factoid{ + Id: bson.NewObjectId(), Idx: id, Trigger: trigger, Operator: "reply", @@ -96,7 +98,9 @@ func (p *RememberPlugin) Message(message bot.Message) bool { LastAccessed: time.Now(), AccessCount: 0, } - p.Coll.Insert(fact) + if err = p.Coll.Insert(fact); err != nil { + log.Println("ERROR!!!!:", err) + } // sorry, not creative with names so we're reusing msg msg = fmt.Sprintf("Okay, %s, remembering '%s'.",