From 776d3635951d7336eb5159f9b0152c56b91cacdb Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Sat, 31 Aug 2013 22:24:10 -0400 Subject: [PATCH] Fixes #32: Make quote/remember case insensitive keywords --- plugins/remember.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/remember.go b/plugins/remember.go index 9bc61f2..6401528 100644 --- a/plugins/remember.go +++ b/plugins/remember.go @@ -39,7 +39,7 @@ func NewRememberPlugin(b *bot.Bot) *RememberPlugin { // execution of other plugins. func (p *RememberPlugin) Message(message bot.Message) bool { - if message.Body == "quote" && message.Command { + if strings.ToLower(message.Body) == "quote" && message.Command { q := p.randQuote() p.Bot.SendMessage(message.Channel, q) @@ -49,7 +49,9 @@ func (p *RememberPlugin) Message(message bot.Message) bool { user := message.User parts := strings.Split(message.Body, " ") - if message.Command && len(parts) >= 3 && parts[0] == "remember" { + if message.Command && len(parts) >= 3 && + strings.ToLower(parts[0]) == "remember" { + // we have a remember! // look through the logs and find parts[1] as a user, if not, // fuck this hoser