From 4a3431efbb51247a79e34b3838d6ba2a9628af7b Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Fri, 18 Nov 2016 16:55:01 +0000 Subject: [PATCH] Fix #59 : Make pling commands case-insensitive --- src/github.com/matrix-org/go-neb/types/actions.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/github.com/matrix-org/go-neb/types/actions.go b/src/github.com/matrix-org/go-neb/types/actions.go index 707fa04..dbe9e7d 100644 --- a/src/github.com/matrix-org/go-neb/types/actions.go +++ b/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 } }