From 3651a957a12531072fa2dba2d333b38c5b59272f Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Sun, 14 Feb 2021 21:19:07 +0100 Subject: [PATCH] added emoji command that returns the url of the emoji --- commands/emoji.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 commands/emoji.js diff --git a/commands/emoji.js b/commands/emoji.js new file mode 100644 index 0000000..61d5f3f --- /dev/null +++ b/commands/emoji.js @@ -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); + } +}; \ No newline at end of file