discord_bot/commands/misc/emoji.js
SileNce5k ac9b59281e
All checks were successful
CI / CI (push) Successful in 18s
Lint Codebase / eslint (push) Successful in 12s
Fix all eslint warnings
2024-11-05 06:32:40 +01:00

28 lines
No EOL
765 B
JavaScript

module.exports = {
name: 'e',
description: 'Returns emoji url',
moreHelp: ["Works with both animated and static emojis"],
execute({ message, args }) {
let emoji = args.join(` `);
if (!emoji) {
message.channel.send("no emoji");
return;
}
let extension = ".png"
if (args[0].charAt(1) == "a") {
extension = ".gif";
}
let num = emoji.split(":")[2];
try {
num = num.slice(0, -1);
} catch (e) {
console.error(e)
message.channel.send("There was an error. Check the logs");
return;
}
message.channel.send("https://cdn.discordapp.com/emojis/" + num + extension);
}
};