Fixed emote classic command

This commit is contained in:
Essem 2022-04-23 18:41:05 -05:00 committed by GitHub
parent c4e31ac409
commit 73a2fd9856
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,7 +3,7 @@ import Command from "../../classes/command.js";
class EmoteCommand extends Command {
async run() {
const emoji = this.type === "classic" ? this.args.join(" ") : this.options.emoji;
const emoji = this.type === "classic" ? this.content : this.options.emoji;
if (!emoji || !emoji.trim()) return "You need to provide an emoji!";
if (emoji.split(" ")[0].match(/^<a?:.+:\d+>$/)) {
return `https://cdn.discordapp.com/emojis/${emoji.split(" ")[0].replace(/^<(a)?:.+:(\d+)>$/, "$2")}.${emoji.split(" ")[0].replace(/^<(a)?:.+:(\d+)>$/, "$1") === "a" ? "gif" : "png"}`;