forked from ChrisChrome/weather-bot
Im dumb, thats not right
This commit is contained in:
parent
6679ea55c6
commit
86d5105579
7
index.js
7
index.js
|
@ -1232,16 +1232,13 @@ discord.on("interactionCreate", async (interaction) => {
|
||||||
interaction.editReply({ content: "Failed to get outlook", ephemeral: true });
|
interaction.editReply({ content: "Failed to get outlook", ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// get date and expires headers, convert them to Date objects
|
// debug log toLocalString of timestamps
|
||||||
date = new Date(res.headers.get("date"));
|
console.log(issued.toLocaleString());
|
||||||
expires = new Date(res.headers.get("expires"));
|
|
||||||
|
|
||||||
// Returns image, send embed with image as attachment (we need to bypass discord cache)
|
// Returns image, send embed with image as attachment (we need to bypass discord cache)
|
||||||
res.buffer().then(async (buffer) => {
|
res.buffer().then(async (buffer) => {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: `${toTitleCase(type)} Outlook Day ${day + 1}`,
|
title: `${toTitleCase(type)} Outlook Day ${day + 1}`,
|
||||||
description: `Issued <t:${Math.floor(date.getTime() / 1000)}:R> <t:${Math.floor(date.getTime() / 1000)}:t>\nExpires <t:${Math.floor(expires.getTime() / 1000)}:R> <t:${Math.floor(expires.getTime() / 1000)}:t>`,
|
|
||||||
image: {
|
image: {
|
||||||
url: `attachment://${type}_${day}.png`
|
url: `attachment://${type}_${day}.png`
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue