discord.js/src/util/ParseEmoji.js
2016-10-27 18:52:49 +01:00

14 lines
279 B
JavaScript

module.exports = function parseEmoji(text) {
if (text.includes('%')) {
text = decodeURIComponent(text);
}
if (text.includes(':')) {
const [name, id] = text.split(':');
return { name, id };
} else {
return {
name: text,
id: null,
};
}
};