diff --git a/plugins/remember.go b/plugins/remember.go index 1cf508a..4d91d54 100644 --- a/plugins/remember.go +++ b/plugins/remember.go @@ -60,6 +60,7 @@ func (p *RememberPlugin) Message(message bot.Message) bool { var trigger string for _, snip := range snips { + snip = strings.TrimSpace(snip) snipParts := strings.Split(snip, " ") nick := snipParts[0] snip := strings.Join(snipParts[1:], " ") @@ -67,6 +68,8 @@ func (p *RememberPlugin) Message(message bot.Message) bool { for i := len(p.Log[message.Channel]) - 1; i >= 0; i-- { entry := p.Log[message.Channel][i] + log.Println("Test entry:", entry.User.Name, entry.Body) + if strings.ToLower(entry.User.Name) == strings.ToLower(nick) && strings.Contains( strings.ToLower(entry.Body), @@ -117,6 +120,8 @@ func (p *RememberPlugin) Message(message bot.Message) bool { log.Println("ERROR!!!!:", err) } + log.Println("Remembering factoid:", msg) + // sorry, not creative with names so we're reusing msg msg = fmt.Sprintf("Okay, %s, remembering '%s'.", message.User.Name, msg)