mirror of
https://github.com/discordjs/discord.js.git
synced 2026-06-03 09:30:08 +00:00
15 lines
279 B
JavaScript
15 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,
|
|
};
|
|
}
|
|
};
|