node-emoji icon indicating copy to clipboard operation
node-emoji copied to clipboard

Custom emoji

Open gHashTag opened this issue 4 years ago • 3 comments

Many icons are missing in the project. To add you need to follow these instructions.

How to understand what is encrypted here?

"0023-fe0f-20e3":[["\u0023\uFE0F\u20E3","\u0023\u20E3"],"\uE210","\uDBBA\uDC2C",["hash"],0,0,15,0],

I know that version 2 is planned, but now I need this library to work.

How do you encrypt these characters? Can you show one example?

garlic 🧄 moon_cake 🥮 salt 🧂 avocado 🥑 birthday cake 🎂 bagel 🍩 beverage_box 🧃 ice_cube 🧊 falafel 🧆 waffle 🧇 leafy_green 🥬 mate_drink 🧉 cupcake 🧁 butter 🧈 onion 🧅

gHashTag avatar Aug 06 '20 14:08 gHashTag

@gHashTag The "encrypted" values are actually hexadecimal numbers, each of which is assigned to a unicode value. For example, the unicode value of a is \u0061. Here's the full table.

Richienb avatar Aug 07 '20 01:08 Richienb

@Richienb Let's say I want to add leafy_green 🥬 Its Unicode u1F96C How to add it to lib / emojifile.js file There, besides him, is full of other attributes, where can I get them?

"0023-fe0f-20e3":[["\u0023\uFE0F\u20E3","\u0023\u20E3"],"\uE210","\uDBBA\uDC2C",["hash"],0,0,15,0],

How to do it right?

function convert(emojiString, alias) {
  let key = 'custom'
  let value = ''
  for (let i = 0; i < emojiString.length; i++) {
    const code = emojiString[i].codePointAt(0).toString(16).padStart(4, 0)
    key += '-' + code
    value += '\\u' + code.toUpperCase()
  }

  console.log(`"${key}":[["${value}"],"","",["${alias}"]],`)
}

convert('🥬', 'leafy_green')

gHashTag avatar Aug 07 '20 04:08 gHashTag

Hi i am getting :waving_black_flag: when i add flag-england(🏴󠁧󠁢󠁥󠁮󠁧󠁿) or flag-scotland(🏴󠁧󠁢󠁳󠁣󠁴󠁿) or flag-wales(🏴󠁧󠁢󠁷󠁬󠁳󠁿) when i unemojify. so again when i do emojify that :waving_black_flag: string, i am getting following output: OUTPUT: 🏴?????????????????????????.

Why 🏴󠁧󠁢󠁥󠁮󠁧󠁿 🏴󠁧󠁢󠁳󠁣󠁴󠁿 flags are not decoded even if their codes are mentioned in emojifile.js?

Dhanraj-Naik avatar Mar 06 '21 08:03 Dhanraj-Naik

👋 Closing out this old issue now that the v2 is released (#113). If anybody still has a desire to add in custom emojis, please do file a new issue explaining why.

Note that we're also working on bumping to v3 of emojilib (#129).

JoshuaKGoldberg avatar May 20 '23 15:05 JoshuaKGoldberg