f5a8c5a45d
Signed-off-by: Michael Mayer <michael@photoprism.app>
21 lines
430 B
Go
21 lines
430 B
Go
package react
|
|
|
|
// Find finds a reaction by name and emoji.
|
|
func Find(reaction string) Emoji {
|
|
if reaction == "" {
|
|
return Unknown
|
|
}
|
|
|
|
if found := Reactions[reaction]; found != "" {
|
|
return found
|
|
} else if found = Emoji(reaction); found.Unknown() {
|
|
return Unknown
|
|
} else {
|
|
return found
|
|
}
|
|
}
|
|
|
|
// Known checks if the emoji represents a known reaction.
|
|
func Known(reaction string) bool {
|
|
return !Find(reaction).Unknown()
|
|
}
|