Skip to content
Snippets Groups Projects

Channels impl

Merged Benjamin Wenger requested to merge channelsImpl into project/Channels
7 files
+ 75
34
Compare changes
  • Side-by-side
  • Inline
Files
7
+ 16
0
package channels
import (
"github.com/forPelevin/gomoji"
"github.com/pkg/errors"
)
var InvalidReaction = errors.New("The reaction is not valid, " +
"it must be a single emoji")
// ValidateReaction checks that the reaction only contains a single Emoji
func ValidateReaction(reaction string) error {
if len(gomoji.RemoveEmojis(reaction)) > 0 {
return InvalidReaction
}
if len(gomoji.FindAll(reaction)) != 1 {
return InvalidReaction
}
return nil
}
Loading