From 14faf62e909bf0ce45f371552e233675bbcf55e8 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Sun, 19 May 2024 10:24:48 -0600 Subject: [PATCH] I don't like Discord attachments. --- index.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 1632b75..21857fa 100644 --- a/index.js +++ b/index.js @@ -1234,13 +1234,18 @@ discord.on("interactionCreate", async (interaction) => { } // Returns image, send embed with image as attachment (we need to bypass discord cache) res.buffer().then(async (buffer) => { - const attachment = new Discord.MessageAttachment(buffer, `${type}_${day}.png`); - const embed = { - title: `${toTitleCase(type)} Outlook Day ${day}`, - image: { - url: `attachment://${type}_${day}.png` - }, - color: 0x00ff00 + const message = { + embeds: [{ + title: `${toTitleCase(type)} Outlook Day ${day}`, + image: { + url: `attachment://${type}_${day}.png` + }, + color: 0x00ff00 + }], + files: [{ + attachment: buffer, + name: `${type}_${day}.png` + }] } interaction.editReply({ embeds: [embed], files: [attachment] }); });