discord_bot/commands/misc/emoji.js
SileNce5k e7cdd425d1
Split commands into subdirectories
* Move command files into directories

* Edit relative paths

* Update gitignore

* Finish support for commands in subdir

* Split up getCommandFiles into own function

* Add support for subdirs on help command
2021-07-18 11:24:46 +02:00

27 lines
No EOL
721 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) {
message.channel.send("There was an error.");
return;
}
message.channel.send("https://cdn.discordapp.com/emojis/" + num + extension);
}
};