From 7a0a34cb98640e70dc8f38ad358c0a1c6335f79d Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Sun, 22 Oct 2023 14:24:53 +0500 Subject: [PATCH] add image if attached in quote --- events/MessageHandler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/events/MessageHandler.js b/events/MessageHandler.js index cc533745..a6a3805d 100644 --- a/events/MessageHandler.js +++ b/events/MessageHandler.js @@ -68,6 +68,8 @@ class MessageCreate extends BaseEvent { ]); if (msg.attachments.size > 0) { + if (msg.attachments.find(a => a.contentType.includes("image/"))) embed.setImage(msg.attachments.find(a => a.contentType.includes("image/")).url); + embed.addFields([ { name: message.translate("misc:QUOTE_ATTACHED"), @@ -91,8 +93,6 @@ class MessageCreate extends BaseEvent { collector.on("collect", async i => { if (i.isButton() && i.customId === "quote_delete") { - console.log(i.message); - if (i.message.deletable) i.message.delete(); } });