emoji

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2019 License: MIT Imports: 4 Imported by: 0

Documentation ΒΆ

Index ΒΆ

Constants ΒΆ

View Source
const (
	ID    = "πŸ†”"
	KEY   = "πŸ”‘"
	BOX   = "πŸ“¦"
	GIFT  = "🎁"
	CLOCK = "⏰"
	FLAG  = "🚩"
	TOOL  = "πŸ”§"
	GUN   = "πŸ”«"
	DING  = "πŸ“Œ"
	STOP  = "🚫"

	DOC     = "πŸ“„"
	DIR     = "πŸ“‚"
	BOOK    = "πŸ“”"
	RECYCLE = "β™»"

	EDIT  = "✍"
	SMILE = "😊"
	LAUGH = "πŸ˜†"
	LIKE  = "😍"
	ANGER = "😑"
	HAPPY = "πŸ˜€"
	DOZE  = "😴"

	OK     = "πŸ‘Œ"
	YES    = "✌"
	NO     = "βœ‹"
	PRAISE = "πŸ‘"
	TREAD  = "πŸ‘Ž"
	STEP   = "🐾"

	UP    = "πŸ‘†"
	DOWN  = "πŸ‘‡"
	LEFT  = "πŸ‘ˆ"
	RIGHT = "πŸ‘‰"

	FIRE  = "πŸ”₯"
	SNOW  = "❄"
	WATER = "πŸ’§"
	FLASH = "⚑"

	EYE        = "πŸ‘€"
	HEART      = "πŸ’–"
	HEARTBREAK = "πŸ’”"

	SUC      = "βœ…"
	FAIL     = "❌"
	WAN      = "❗"
	QUESTION = "❓"

	CAR = "πŸš•"

	TREE   = "🌲"
	FLOWER = "🌺"

	PEAR  = "🍐"
	APPLE = "🍎"

	ELEPHANT = "🐘"
	WHALE    = "🐳"

	SUN   = "🌞"
	STAR  = "⭐"
	MOON  = "🌜"
	EARTH = "🌏"
)

some simple emoji chars

Variables ΒΆ

This section is empty.

Functions ΒΆ

func Decode ΒΆ

func Decode(s string) string

Decode a string, convert unicode to emoji chat Usage:

str := Decode("a msg [\u1f496]")

func Emoji ΒΆ

func Emoji(name string) string

Emoji is alias of the GetByName()

func Encode ΒΆ

func Encode(s string) string

Encode a string, convert emoji chat to unicode string

func FromUnicode ΒΆ

func FromUnicode(s string) string

FromUnicode unicode string to emoji string Usage:

emoji := FromUnicode("\U0001f496")

func GetByName ΒΆ

func GetByName(name string) string

GetByName returns the unicode value for the given emoji name. If the specified emoji does not exist, will returns the input string.

func Render ΒΆ

func Render(str string) string

Render a string, parse emoji name, returns rendered string. Usage:

msg := Render("a :smile: message")
fmt.Println(msg)
func Search(kw string, limits ...int) (ret map[string]string)

Search emoji by name

func ToUnicode ΒΆ

func ToUnicode(emoji string, prefix ...string) string

ToUnicode unicode string to emoji string Usage:

unicode := ToUnicode("πŸ’–")
fmt.Print(unicode) // "1f496"
// with prefix
unicode := ToUnicode("πŸ’–", "\U000") // "\U0001f496"
fmt.Print(unicode) // "πŸ’–"

Types ΒΆ

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL