2023-07-17 13:51:31 +00:00
|
|
|
package gmproto
|
2023-06-30 09:54:08 +00:00
|
|
|
|
2023-07-12 21:44:57 +00:00
|
|
|
func (et EmojiType) Unicode() string {
|
|
|
|
switch et {
|
|
|
|
case EmojiType_LIKE:
|
|
|
|
return "👍"
|
|
|
|
case EmojiType_LOVE:
|
|
|
|
return "😍"
|
|
|
|
case EmojiType_LAUGH:
|
|
|
|
return "😂"
|
|
|
|
case EmojiType_SURPRISED:
|
|
|
|
return "😮"
|
|
|
|
case EmojiType_SAD:
|
|
|
|
return "😥"
|
|
|
|
case EmojiType_ANGRY:
|
|
|
|
return "😠"
|
|
|
|
case EmojiType_DISLIKE:
|
|
|
|
return "👎"
|
|
|
|
case EmojiType_QUESTIONING:
|
|
|
|
return "🤔"
|
|
|
|
case EmojiType_CRYING_FACE:
|
|
|
|
return "😢"
|
|
|
|
case EmojiType_POUTING_FACE:
|
|
|
|
return "😡"
|
|
|
|
case EmojiType_RED_HEART:
|
|
|
|
return "❤️"
|
|
|
|
default:
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func UnicodeToEmojiType(emoji string) EmojiType {
|
|
|
|
switch emoji {
|
|
|
|
case "👍":
|
|
|
|
return EmojiType_LIKE
|
|
|
|
case "😍":
|
|
|
|
return EmojiType_LOVE
|
|
|
|
case "😂":
|
|
|
|
return EmojiType_LAUGH
|
|
|
|
case "😮":
|
|
|
|
return EmojiType_SURPRISED
|
|
|
|
case "😥":
|
|
|
|
return EmojiType_SAD
|
|
|
|
case "😠":
|
|
|
|
return EmojiType_ANGRY
|
|
|
|
case "👎":
|
|
|
|
return EmojiType_DISLIKE
|
|
|
|
case "🤔":
|
|
|
|
return EmojiType_QUESTIONING
|
|
|
|
case "😢":
|
|
|
|
return EmojiType_CRYING_FACE
|
|
|
|
case "😡":
|
|
|
|
return EmojiType_POUTING_FACE
|
2024-03-07 23:41:56 +00:00
|
|
|
case "❤", "❤️":
|
|
|
|
return EmojiType_RED_HEART
|
2023-07-12 21:44:57 +00:00
|
|
|
default:
|
|
|
|
return EmojiType_CUSTOM
|
|
|
|
}
|
|
|
|
}
|
2023-07-14 22:22:20 +00:00
|
|
|
|
|
|
|
func MakeReactionData(emoji string) *ReactionData {
|
|
|
|
return &ReactionData{
|
|
|
|
Unicode: emoji,
|
|
|
|
Type: UnicodeToEmojiType(emoji),
|
|
|
|
}
|
|
|
|
}
|