Function emojic::text::parse_alias
source · [−]Expand description
Parses the given Emoji name into a unicode Emoji.
This function accepts strings of the form :name:
and looks up an emojis for it.
The list of valid names is taken from: github/gemoji
And additonally all the constant names (as listed in crate::flat
) are also valid aliases
when spelled in lowercase.
Examples
use emojic::parse_alias;
// gemoji style
assert_eq!(
Some(&*emojic::flat::THUMBS_UP),
parse_alias(":+1:") //👍
);
// constant name style
assert_eq!(
Some(&emojic::flat::ALIEN_MONSTER),
parse_alias(":alien_monster:") //👾
);