diff --git a/commands/interaction/slash/utils/weather.js b/commands/interaction/slash/utils/weather.js index 5835d1b..6e5784d 100644 --- a/commands/interaction/slash/utils/weather.js +++ b/commands/interaction/slash/utils/weather.js @@ -54,9 +54,9 @@ module.exports = { // Render weather alerts if(data.result.warnings.length >= 1){ - description += `\n` - for(const w of data.result.warnings){ - description += `\n${icon("warning")} **${w.label}**\n-# ${w.source} • ${link(w.url, "Learn More", "Learn more about this alert")}` + for(const w of data.result.warnings.splice(0, 2)){ + if(description.includes(w.label)) continue; + description += `\n\n${icon("warning")} **${w.label}**\n-# ${w.source} • ${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 b27e159..fc5e116 100644 --- a/commands/message/utils/weather.js +++ b/commands/message/utils/weather.js @@ -41,9 +41,9 @@ module.exports = { // Render weather alerts if(data.result.warnings.length >= 1){ - description += `\n` - for(const w of data.result.warnings){ - description += `\n${icon("warning")} **${w.label}**\n-# ${w.source} • ${link(w.url, "Learn More", "Learn more about this alert")}` + for(const w of data.result.warnings.splice(0, 2)){ + if(description.includes(w.label)) continue; + description += `\n\n${icon("warning")} **${w.label}**\n-# ${w.source} • ${link(w.url, "Learn More", "Learn more about this alert")}` } }