Skip to content

Complete emoji update

Mateusz Brawański requested to merge github/fork/uwx/patch-107 into master

Created by: uwx

Summary

I re-generated the builtin emoji list based on Emzi's new emote dump.

Details

This is the code that was used to generate the list:

var a = JSON.parse(document.body.textContent)

var codpos = {}
a.emojiDefinitions.forEach(e => e.namesWithColons.forEach(n => {
	codpos[n] = e.utf32codepoints;
}));

function pad(n, width, z) {
  z = z || '0';
  n = n + '';
  return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
}

Object.entries(codpos).map(e => `[${JSON.stringify(e[0])}] = "${e[1].map(s => '\\U' + pad(s.toString(16), 8)).join('')}",`).join('\n');

Yeah, it's very messy. Run it on https://static.emzi0767.com/misc/discordEmojiMap.json in the developer console.

Changes proposed

  • Update emoji dictionary in DiscordEmoji.EmojiUtils

Notes

This PR probably needs to be tested considering how huge it is. I just don't know how to do that yet.

Merge request reports

Loading