mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 06:33:05 -04:00
wrap warnings
This commit is contained in:
parent
f4a003cc55
commit
d83a4d0503
2 changed files with 7 additions and 7 deletions
|
@ -2,7 +2,7 @@ const { darksky } = require('#api');
|
|||
|
||||
const { createEmbed } = require('#utils/embed');
|
||||
const { acknowledge } = require('#utils/interactions');
|
||||
const { pill, iconPill, smallPill, weatherIcon, timestamp, icon, link} = require('#utils/markdown');
|
||||
const { pill, iconPill, smallPill, weatherIcon, timestamp, icon, link, stringwrap} = require('#utils/markdown');
|
||||
const { editOrReply } = require('#utils/message');
|
||||
const { STATICS } = require('#utils/statics');
|
||||
|
||||
|
@ -54,9 +54,9 @@ module.exports = {
|
|||
|
||||
// Render weather alerts
|
||||
if(data.result.warnings.length >= 1){
|
||||
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")}`
|
||||
for(const w of data.result.warnings.splice(0, 1)){
|
||||
if(description.includes(stringwrap(w.label, 50))) continue;
|
||||
description += `\n\n${icon("warning")} **${stringwrap(w.label, 50)}**\n-# ${stringwrap(w.source, 50)} • ${link(w.url, "Learn More", "Learn more about this alert")}`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,9 +41,9 @@ module.exports = {
|
|||
|
||||
// Render weather alerts
|
||||
if(data.result.warnings.length >= 1){
|
||||
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")}`
|
||||
for(const w of data.result.warnings.splice(0, 1)){
|
||||
if(description.includes(stringwrap(w.label, 50))) continue;
|
||||
description += `\n\n${icon("warning")} **${stringwrap(w.label, 50)}**\n-# ${stringwrap(w.source, 50)} • ${link(w.url, "Learn More", "Learn more about this alert")}`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue