added emoji command that returns the url of the emoji
This commit is contained in:
parent
23f3a61fa1
commit
3651a957a1
1 changed files with 24 additions and 0 deletions
24
commands/emoji.js
Normal file
24
commands/emoji.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
module.exports = {
|
||||
name: 'e',
|
||||
description: 'Returns emoji url',
|
||||
execute(message, args) {
|
||||
let emoji = args.join(` `);
|
||||
|
||||
if (!emoji) {
|
||||
message.channel.send("no emoji");
|
||||
return;
|
||||
}
|
||||
var extension = ".png";
|
||||
if (args[0].charAt(1) == "a") {
|
||||
extension = ".gif";
|
||||
}
|
||||
|
||||
var num = emoji.split(":")[2];
|
||||
try {
|
||||
num = num.slice(0, -1);
|
||||
} catch (e) {
|
||||
message.channel.send("There was an error.");
|
||||
}
|
||||
message.channel.send("https://cdn.discordapp.com/emojis/" + num + extension);
|
||||
}
|
||||
};
|
Loading…
Add table
Reference in a new issue