Lua-Emoji: Discord style emoji aliases

:smile: lua-emoji :smile:

I put together a module that allows you to convert text to Unicode emojis as you would in a chat client like Discord.
For example:


local emoji = require(path.to.emoji)

print(emoji("emojis are :ok_hand:!"))

-- output: emojis are 👌!

lua-emoji also supports skin tones!

emoji() takes an optional second argument for the skin tone. Available skin tones are

  • emoji.Light
  • emoji.Dark
  • emoji.MediumLight
  • emoji.MediumDark
  • emoji.Medium
print(emoji(":thumbsup:", emoji.MediumDark))
-- output: 👍🏾

Skin tones can also be added for individual emojis using the suffixes d, md, m, ml, and l:

print(emoji(":raisedfist_d: :raisedfist_md: :raisedfist_m: :raisedfist_ml: :raisedfist_l:"))
-- output: ✊🏿 ✊🏾 ✊🏽 ✊🏼 ✊🏻

Aliases

Several aliases can be used for each emoji depending on your preferences:

print(emoji(":thumbs_up: = :thumbs-up: = :thumbsup:"))
-- output: 👍 = 👍 = 👍

lua-emoji also allows you to use ISO country codes from https://countrycode.org/ for flags.

Install

All the code is in one module, so you can install it by downloading the emoji.lua file from the GitHub repository and inserting it in your game.

Resources

The emoji list is generated from Taehoon Kim’s emoji for Python.

58 Likes

Been waiting for a roblox supported version of something like this, especially in a chat setting, thanks for this!

6 Likes