From 6679ea55c66a67ce72a69ced38131e0e31726574 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Sun, 19 May 2024 18:32:00 -0600 Subject: [PATCH] Attempt at adding timestamps :skull: --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index 4d388e5..6a1961d 100644 --- a/index.js +++ b/index.js @@ -1232,11 +1232,16 @@ discord.on("interactionCreate", async (interaction) => { interaction.editReply({ content: "Failed to get outlook", ephemeral: true }); return; } + // get date and expires headers, convert them to Date objects + date = new Date(res.headers.get("date")); + expires = new Date(res.headers.get("expires")); + // Returns image, send embed with image as attachment (we need to bypass discord cache) res.buffer().then(async (buffer) => { interaction.editReply({ embeds: [{ title: `${toTitleCase(type)} Outlook Day ${day + 1}`, + description: `Issued \nExpires `, image: { url: `attachment://${type}_${day}.png` },