mirror of
https://github.com/danbulant/discord.js
synced 2026-05-26 13:32:04 +00:00
14 lines
279 B
JavaScript
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,
|
|
};
|
|
}
|
|
};
|