Smile
Small library for converting emoji shortnames to emoji characters, like in Discord messages:
Smile.convert_text("LMAO :joy:")
# > "LMAO 😂"
This is a fork of the original project that uses Discord-style shortcodes instead of the full unicode "CLDR Short Name".
For example, :face_with_tears_of_joy:
is the official unicode-approved short name, but this fork uses :joy:
instead.
There are some known issues:
- Emojis in the middle of other don't work, ex.
:woo:poop:hoo:
would not convert the:poop:
in the middle.
Installation
Available via GitHub, the package can be installed as:
-
Add
:smile
to your list of dependencies inmix.exs
:def deps do [ {:smile, github: "RobinBoers/smile"} ] end
-
Ensure
smile
is started before your application:def application do [applications: [:smile]] end