Send unsanitized content to commands via content parameter, fixed emote command, removed another async promise

This commit is contained in:
TheEssem 2021-03-16 13:24:21 -05:00
parent cb8f939378
commit 74baa29684
3 changed files with 10 additions and 11 deletions

View file

@ -1,9 +1,9 @@
const emojiRegex = require("emoji-regex");
exports.run = async (message, args) => {
exports.run = async (message, args, content) => {
if (args.length === 0) return `${message.author.mention}, you need to provide an emoji!`;
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"}`;
if (content.split(" ")[0].match(/^<a?:.+:\d+>$/)) {
return `https://cdn.discordapp.com/emojis/${content.split(" ")[0].replace(/^<(a)?:.+:(\d+)>$/, "$2")}.${content.split(" ")[0].replace(/^<(a)?:.+:(\d+)>$/, "$1") === "a" ? "gif" : "png"}`;
} else if (args[0].match(emojiRegex)) {
const codePoints = [];
for (const codePoint of args[0]) {