2019-12-05 16:58:46 +00:00
|
|
|
const emojiRegex = require("emoji-regex");
|
|
|
|
|
|
|
|
exports.run = async (message, args) => {
|
2019-12-09 20:52:33 +00:00
|
|
|
if (args.length === 0) return `${message.author.mention}, you need to provide an emoji!`;
|
2019-12-05 16:58:46 +00:00
|
|
|
if (args[0].match(/^<a?:.+:\d+>$/)) {
|
|
|
|
return `https://cdn.discordapp.com/emojis/${args[0].replace(/^<(a)?:.+:(\d+)>$/, "$2")}.${args[0].replace(/^<(a)?:.+:(\d+)>$/, "$1") === "a" ? "gif" : "png"}`;
|
|
|
|
} else if (args[0].match(emojiRegex)) {
|
|
|
|
const codePoints = [];
|
|
|
|
for (const codePoint of args[0]) {
|
|
|
|
codePoints.push(codePoint.codePointAt(0).toString(16));
|
|
|
|
}
|
|
|
|
return `https://twemoji.maxcdn.com/v/latest/72x72/${codePoints.join("-")}.png`;
|
|
|
|
} else {
|
|
|
|
return `${message.author.mention}, you need to provide a valid emoji to get an image!`;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-12-09 20:52:33 +00:00
|
|
|
exports.aliases = ["e", "em", "hugemoji", "hugeemoji", "emoji"];
|
2019-12-05 16:58:46 +00:00
|
|
|
exports.category = 1;
|
|
|
|
exports.help = "Gets a raw emote image";
|
|
|
|
exports.params = "[emote]";
|