From 4b523be57fb227b1dec7c906736b953229345444 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Sun, 26 Aug 2012 15:21:21 -0400 Subject: [PATCH] Made factoid triggers lowercase always --- plugins/factoid.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/factoid.go b/plugins/factoid.go index 58dd91a..48b6d31 100644 --- a/plugins/factoid.go +++ b/plugins/factoid.go @@ -66,7 +66,7 @@ func (p *FactoidPlugin) learnFact(message bot.Message, trigger, operator, fact s func (p *FactoidPlugin) findTrigger(message string) (bool, string) { var results []factoid - iter := p.Coll.Find(bson.M{"trigger": message}).Iter() + iter := p.Coll.Find(bson.M{"trigger": strings.ToLower(message)}).Iter() err := iter.All(&results) if err != nil { panic(err) @@ -101,6 +101,7 @@ func (p *FactoidPlugin) Message(message bot.Message) bool { } trigger := strings.TrimSpace(parts[0]) + trigger = strings.ToLower(trigger) fact := strings.TrimSpace(parts[1]) action := strings.TrimSpace(action)