mirror of https://github.com/velour/catbase.git
Fixing case issues
This commit is contained in:
parent
a779dc4720
commit
13b77ad2b1
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue