diff --git a/channels/emoji.go b/channels/emoji.go index fb25f158584f4b6fc839108120dcfd531c222e40..71c7ae4f66dd6b96e812521056f44a548fbf74c6 100644 --- a/channels/emoji.go +++ b/channels/emoji.go @@ -15,7 +15,7 @@ import ( //based on emojis found at https://unicode.org/emoji/charts/full-emoji-list.html const findEmoji = `[\xA9\xAE\x{2000}-\x{3300}\x{1F000}-\x{1FBFF}]` -var compiledRegex = regexp.MustCompile(findEmoji) +var compiledFindEmoji = regexp.MustCompile(findEmoji) // ValidateReaction checks that the reaction only contains a single emoji. func ValidateReaction(reaction string) error { @@ -29,7 +29,7 @@ func ValidateReaction(reaction string) error { reader := bytes.NewReader([]byte(reaction)) // make sure it has emojis - if !compiledRegex.MatchReader(reader) { + if !compiledFindEmoji.MatchReader(reader) { return InvalidReaction }