From 13b77ad2b12399b2f49ddb2b191d3b42aa532c8b Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Thu, 7 Feb 2013 17:37:38 -0500 Subject: [PATCH] Fixing case issues --- bot/handlers.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bot/handlers.go b/bot/handlers.go index 0cec534..b5389c1 100644 --- a/bot/handlers.go +++ b/bot/handlers.go @@ -83,12 +83,12 @@ func (b *Bot) isCmd(message string) (bool, string) { cmdc := b.Config.CommandChar botnick := strings.ToLower(b.Conn.Me.Nick) iscmd := false - message = strings.ToLower(message) + lowerMessage := strings.ToLower(message) - if strings.HasPrefix(message, cmdc) && len(cmdc) > 0 { + if strings.HasPrefix(lowerMessage, cmdc) && len(cmdc) > 0 { iscmd = true message = message[len(cmdc):] - } else if strings.HasPrefix(message, botnick) { + } else if strings.HasPrefix(lowerMessage, botnick) { iscmd = true message = message[len(botnick):] @@ -138,6 +138,7 @@ func (b *Bot) buildMessage(conn *irc.Conn, line *irc.Line) Message { Action: isaction, Time: time.Now(), } + return msg }