Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom emoji #95

Closed
gHashTag opened this issue Aug 6, 2020 · 4 comments
Closed

Custom emoji #95

gHashTag opened this issue Aug 6, 2020 · 4 comments

Comments

@gHashTag
Copy link

gHashTag commented Aug 6, 2020

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 🧅

@Richienb
Copy link
Collaborator

Richienb commented Aug 7, 2020

@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.

@gHashTag
Copy link
Author

gHashTag commented Aug 7, 2020

@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')

@Dhanraj-Naik
Copy link

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?

@JoshuaKGoldberg
Copy link
Collaborator

👋 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants