Update userMentionRE to play nice with punctuation.

This commit is contained in:
Nicholas DiGirolamo 2025-02-27 16:23:29 -05:00
parent bab3681ac2
commit 6474ad4ee2

View File

@ -160,7 +160,7 @@ func (b *Bdiscord) getCategoryChannelName(name, parentID string) string {
var (
// See https://discordapp.com/developers/docs/reference#message-formatting.
channelMentionRE = regexp.MustCompile("<#[0-9]+>")
userMentionRE = regexp.MustCompile("@[^@\n]{1,32}")
userMentionRE = regexp.MustCompile("\(*@[^@\n]{1,32}(\,|\:|;\))*")
emoteRE = regexp.MustCompile(`<a?(:\w+:)\d+>`)
)