Fixes #41: Don't require a space for a command

This commit is contained in:
Chris Sexton 2013-08-26 12:18:31 -04:00
parent f715ab93e1
commit 0627f8a015
1 changed files with 1 additions and 3 deletions

View File

@ -63,9 +63,7 @@ func (b *Bot) isCmd(message string) (bool, string) {
// } else if match, _ := regexp.MatchString(rex, lowerMessage); match {
} else if strings.HasPrefix(lowerMessage, botnick) &&
len(lowerMessage) > len(botnick) &&
(lowerMessage[len(botnick)] == ',' ||
lowerMessage[len(botnick)] == ':') &&
lowerMessage[len(botnick)+1] == ' ' {
(lowerMessage[len(botnick)] == ',' || lowerMessage[len(botnick)] == ':') {
iscmd = true
message = message[len(botnick):]