Browse Source

Merge pull request #123 from matrix-org/kegan/case-insensitive-commands

Fix #59 : Make pling commands case-insensitive
kegan/github-say-which-labels
Kegsay 8 years ago
committed by GitHub
parent
commit
aba9820844
  1. 7
      src/github.com/matrix-org/go-neb/types/actions.go

7
src/github.com/matrix-org/go-neb/types/actions.go

@ -1,6 +1,9 @@
package types
import "regexp"
import (
"regexp"
"strings"
)
// A Command is something that a user invokes by sending a message starting with '!'
// followed by a list of strings that name the command, followed by a list of argument
@ -28,7 +31,7 @@ func (command *Command) Matches(arguments []string) bool {
return false
}
for i, segment := range command.Path {
if segment != arguments[i] {
if strings.ToLower(segment) != strings.ToLower(arguments[i]) {
return false
}
}

Loading…
Cancel
Save