Fixing case issues

This commit is contained in:
Chris Sexton 2013-02-07 17:37:38 -05:00
parent a779dc4720
commit 13b77ad2b1
1 changed files with 4 additions and 3 deletions

View File

@ -83,12 +83,12 @@ func (b *Bot) isCmd(message string) (bool, string) {
cmdc := b.Config.CommandChar cmdc := b.Config.CommandChar
botnick := strings.ToLower(b.Conn.Me.Nick) botnick := strings.ToLower(b.Conn.Me.Nick)
iscmd := false 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 iscmd = true
message = message[len(cmdc):] message = message[len(cmdc):]
} else if strings.HasPrefix(message, botnick) { } else if strings.HasPrefix(lowerMessage, botnick) {
iscmd = true iscmd = true
message = message[len(botnick):] message = message[len(botnick):]
@ -138,6 +138,7 @@ func (b *Bot) buildMessage(conn *irc.Conn, line *irc.Line) Message {
Action: isaction, Action: isaction,
Time: time.Now(), Time: time.Now(),
} }
return msg return msg
} }