From a1aedea2f4f79a18ed0db10423c181e2060339d5 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Sun, 13 Aug 2023 22:21:29 -0700 Subject: [PATCH] Case insensitive at-mention for the chatbot --- client/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/utils.go b/client/utils.go index 432d6e2..d71d479 100644 --- a/client/utils.go +++ b/client/utils.go @@ -46,7 +46,7 @@ func AtMentioned(c *Client, message string) (bool, string) { // Patterns to look for. var ( reAtMention = regexp.MustCompile( - fmt.Sprintf(`^@?%s|@?%s$`, c.Username(), c.Username()), + fmt.Sprintf(`(?i)^@?%s|@?%s$`, c.Username(), c.Username()), ) ) m := reAtMention.FindStringSubmatch(message)