Case insensitive at-mention for the chatbot
This commit is contained in:
parent
9c8ff88f6e
commit
a1aedea2f4
|
@ -46,7 +46,7 @@ func AtMentioned(c *Client, message string) (bool, string) {
|
||||||
// Patterns to look for.
|
// Patterns to look for.
|
||||||
var (
|
var (
|
||||||
reAtMention = regexp.MustCompile(
|
reAtMention = regexp.MustCompile(
|
||||||
fmt.Sprintf(`^@?%s|@?%s$`, c.Username(), c.Username()),
|
fmt.Sprintf(`(?i)^@?%s|@?%s$`, c.Username(), c.Username()),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
m := reAtMention.FindStringSubmatch(message)
|
m := reAtMention.FindStringSubmatch(message)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user