Fixing quoting split function... again

This commit is contained in:
Chris Sexton 2013-06-16 23:44:24 -04:00
parent bddd4038bb
commit a91ebde376
1 changed files with 5 additions and 3 deletions

View File

@ -48,7 +48,7 @@ func (p *RememberPlugin) Message(message bot.Message) bool {
} }
user := message.User user := message.User
parts := strings.Fields(message.Body) parts := strings.Split(message.Body, " ")
if message.Command && len(parts) >= 3 && parts[0] == "remember" { if message.Command && len(parts) >= 3 && parts[0] == "remember" {
// we have a remember! // we have a remember!
// look through the logs and find parts[1] as a user, if not, // 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 // check if it's an action
if entry.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 { } 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) 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.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) p.Log[message.Channel] = append(p.Log[message.Channel], message)
return false return false