fix duplicate weather warnings

This commit is contained in:
bignutty 2024-07-15 20:58:39 +02:00
parent ed20c7f96a
commit f4a003cc55
2 changed files with 6 additions and 6 deletions

View file

@ -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")}`
}
}