Case insensitive at-mention for the chatbot

ipad-testing
Noah 2023-08-13 22:21:29 -07:00
parent 9c8ff88f6e
commit a1aedea2f4
1 changed files with 1 additions and 1 deletions

View File

@ -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)