Command routing fix.

This commit is contained in:
Ian Byrd 2017-11-21 14:40:49 +02:00
parent ddc9f75fb2
commit b4bec5b6f7
No known key found for this signature in database
GPG Key ID: 598F598CA3B8055F

2
bot.go
View File

@ -83,7 +83,7 @@ func (b *Bot) Handle(endpoint string, handler interface{}) {
b.handlers[endpoint] = handler
}
var cmdRx = regexp.MustCompile(`^\/(\w+)(@(\w+))?(\s|$)`)
var cmdRx = regexp.MustCompile(`^(\/\w+)(@(\w+))?(\s|$)`)
func (b *Bot) handleCommand(m *Message, cmdName, cmdBot string) bool {
// Group-syntax: "/cmd@bot"