From d8b6d04edfa7d78d4e962f4574bd76976c0aaad1 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Thu, 20 Jun 2024 17:55:56 -0600 Subject: [PATCH] Doing stuff to /forecast --- funcs.js | 7 +++---- index.js | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/funcs.js b/funcs.js index ed08344..ca40ce0 100644 --- a/funcs.js +++ b/funcs.js @@ -91,10 +91,9 @@ const generateDiscordEmbeds = (forecastData, numOfDays) => { if (period.icon?.startsWith("/")) { period.icon = `https://api.weather.gov${period.icon}` } - console.log(period.icon) const embed = { title: `${period.name} in ${forecastData.properties.relativeLocation.properties.city} ${forecastData.properties.relativeLocation.properties.state}`, - description: period.detailedForecast, + description: `Valid - \n${period.detailedForecast}`, timestamp: new Date(period.startTime), thumbnail: { url: period.icon, @@ -107,7 +106,7 @@ const generateDiscordEmbeds = (forecastData, numOfDays) => { }, { name: 'Wind', - value: `${period.windDirection} ${period.windSpeed}`, + value: `${period.windDirection}@${period.windSpeed}`, inline: true }, { @@ -122,7 +121,7 @@ const generateDiscordEmbeds = (forecastData, numOfDays) => { ], footer: { - text: 'Data provided by the National Weather Service' + text: `Data provided by the National Weather Service | Elevation ${forecastData.properties.elevation.value}m` } }; embeds.push(embed); diff --git a/index.js b/index.js index 45d5f16..fbc9025 100644 --- a/index.js +++ b/index.js @@ -1285,6 +1285,7 @@ discord.on("interactionCreate", async (interaction) => { await interaction.deferReply(); periods = interaction.options.getInteger("periods") || 1; funcs.getWeatherBySearch(interaction.options.getString("location")).then((weather) => { + if (config.debug >= 1) console.log(JSON.stringify(weather, null, 2)) embeds = funcs.generateDiscordEmbeds(weather, periods); interaction.editReply({ embeds }); }).catch((err) => {