2022-01-08 21:13:02 +00:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
updateEmoji () {
|
2022-09-21 02:03:31 +00:00
|
|
|
const emojis = require('@kazvmoe-infra/unicode-emoji-json/data-by-group')
|
2022-01-08 21:13:02 +00:00
|
|
|
const fs = require('fs')
|
|
|
|
|
|
|
|
Object.keys(emojis)
|
|
|
|
.map(k => {
|
|
|
|
emojis[k].map(e => {
|
|
|
|
delete e.unicode_version
|
|
|
|
delete e.emoji_version
|
|
|
|
delete e.skin_tone_support_unicode_version
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
const res = {}
|
|
|
|
Object.keys(emojis)
|
|
|
|
.map(k => {
|
|
|
|
const groupId = k.replace('&', 'and').replace(/ /g, '-').toLowerCase()
|
|
|
|
res[groupId] = emojis[k]
|
|
|
|
})
|
|
|
|
|
2022-08-19 12:46:53 +00:00
|
|
|
console.info('Updating emojis...')
|
2022-01-08 21:13:02 +00:00
|
|
|
fs.writeFileSync('static/emoji.json', JSON.stringify(res))
|
2022-08-19 12:46:53 +00:00
|
|
|
console.info('Done.')
|
2022-01-08 21:13:02 +00:00
|
|
|
}
|
|
|
|
}
|