Yelnar
Yelnar

Reputation: 674

Replace emoji names to its code

I use emojiarea to make a textarea with Emoji support. When I type a message with Emoji and send it, it uses an emoji name like :smile: but I want to replace this name with its code as in twemoji. So the problem is to find a file or something, where I can find the required replacement. Please, any idea? Thank you!

Upvotes: 1

Views: 523

Answers (1)

Vincent Durmont
Vincent Durmont

Reputation: 813

You can check out the gemoji project which has a json database for the emojis here.

For each entry in the database, the "alias" field will have to be replaced by the "emoji" field.

[
  {
    "emoji": "😄"
  , "description": "smiling face with open mouth and smiling eyes"
  , "aliases": [
      "smile"
    ]
  , "tags": [
      "happy"
    , "joy"
    , "pleased"
    ]
  }
, {
    "emoji": "😃"
  , "description": "smiling face with open mouth"
  , "aliases": [
      "smiley"
    ]
  , "tags": [
      "happy"
    , "joy"
    , "haha"
    ]
  }

  // Etc.
]

Upvotes: 1

Related Questions