From 8332c2c15d3f42dc2f0bdc30723bca316bc46d00 Mon Sep 17 00:00:00 2001 From: ChomeNS Date: Mon, 13 Mar 2023 11:00:06 +0700 Subject: [PATCH] discord attachment fix yup --- plugins/discord.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/discord.js b/plugins/discord.js index cfd0d2a..c111405 100644 --- a/plugins/discord.js +++ b/plugins/discord.js @@ -39,13 +39,15 @@ async function inject (bot, dcclient, config) { try { const attachmentsComponent = [] if (message.attachments) { - for (const value of message.attachments) { + for (const __attachment of message.attachments) { + const _attachment = [...__attachment] + const attachment = _attachment[1] // BEST WAY REAL!?/1?! attachmentsComponent.push({ text: message.content === '' ? '[Attachment]' : ' [Attachment]', // may not be the best fix color: 'green', clickEvent: { action: 'open_url', - value: value.proxyURL + value: attachment.proxyURL } }) }