mirror of https://github.com/velour/catbase.git
Fixes #41: Don't require a space for a command
This commit is contained in:
parent
f715ab93e1
commit
0627f8a015
|
@ -63,9 +63,7 @@ func (b *Bot) isCmd(message string) (bool, string) {
|
||||||
// } else if match, _ := regexp.MatchString(rex, lowerMessage); match {
|
// } else if match, _ := regexp.MatchString(rex, lowerMessage); match {
|
||||||
} else if strings.HasPrefix(lowerMessage, botnick) &&
|
} else if strings.HasPrefix(lowerMessage, botnick) &&
|
||||||
len(lowerMessage) > len(botnick) &&
|
len(lowerMessage) > len(botnick) &&
|
||||||
(lowerMessage[len(botnick)] == ',' ||
|
(lowerMessage[len(botnick)] == ',' || lowerMessage[len(botnick)] == ':') {
|
||||||
lowerMessage[len(botnick)] == ':') &&
|
|
||||||
lowerMessage[len(botnick)+1] == ' ' {
|
|
||||||
|
|
||||||
iscmd = true
|
iscmd = true
|
||||||
message = message[len(botnick):]
|
message = message[len(botnick):]
|
||||||
|
|
Loading…
Reference in New Issue