diff --git a/commands/interaction/slash/utils/weather.js b/commands/interaction/slash/utils/weather.js index 88fa565..2290f8e 100644 --- a/commands/interaction/slash/utils/weather.js +++ b/commands/interaction/slash/utils/weather.js @@ -39,7 +39,7 @@ function renderWeatherCard(context, data, units){ // Render weather alerts if(data.result.warnings.length >= 1){ - for(const w of data.result.warnings.splice(0, 1)){ + for(const w of [data.result.warnings[0]]){ if(description.includes(stringwrap(w.label, 50))) continue; description += `\n\n${icon("weather_warning_" + (w.icon || "generic").toLowerCase())} **${stringwrap(w.label, 50)}**\n-# ${stringwrap(w.source, 50)} • ${link(w.url, "Learn More", "Learn more about this alert")}` } diff --git a/commands/message/utils/weather.js b/commands/message/utils/weather.js index 0d7390d..a7a89ee 100644 --- a/commands/message/utils/weather.js +++ b/commands/message/utils/weather.js @@ -39,7 +39,7 @@ function renderWeatherCard(context, data, units){ // Render weather alerts if(data.result.warnings.length >= 1){ - for(const w of data.result.warnings.splice(0, 1)){ + for(const w of [data.result.warnings[0]]){ if(description.includes(stringwrap(w.label, 50))) continue; description += `\n\n${icon("weather_warning_" + (w.icon || "generic").toLowerCase())} **${stringwrap(w.label, 50)}**\n-# ${stringwrap(w.source, 50)} • ${link(w.url, "Learn More", "Learn more about this alert")}` }