From a91ebde3765847dfcb629461e3d6df8384fd1b10 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Sun, 16 Jun 2013 23:44:24 -0400 Subject: [PATCH] Fixing quoting split function... again --- plugins/remember.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/remember.go b/plugins/remember.go index 7dad974..c259bdd 100644 --- a/plugins/remember.go +++ b/plugins/remember.go @@ -48,7 +48,7 @@ func (p *RememberPlugin) Message(message bot.Message) bool { } user := message.User - parts := strings.Fields(message.Body) + parts := strings.Split(message.Body, " ") if message.Command && len(parts) >= 3 && parts[0] == "remember" { // we have a remember! // look through the logs and find parts[1] as a user, if not, @@ -68,9 +68,9 @@ func (p *RememberPlugin) Message(message bot.Message) bool { // check if it's an action if entry.Action { - msg = fmt.Sprintf("*%s* %s", entry.User.Name, entry.Raw) + msg = fmt.Sprintf("*%s* %s", entry.User.Name, entry.Body) } else { - msg = fmt.Sprintf("<%s> %s", entry.User.Name, entry.Raw) + msg = fmt.Sprintf("<%s> %s", entry.User.Name, entry.Body) } trigger := fmt.Sprintf("%s quotes", entry.User.Name) @@ -111,6 +111,8 @@ func (p *RememberPlugin) Message(message bot.Message) bool { } } p.Bot.SendMessage(message.Channel, "Sorry, I don't know that phrase.") + p.Log[message.Channel] = append(p.Log[message.Channel], message) + return true } p.Log[message.Channel] = append(p.Log[message.Channel], message) return false