From 5a9b91ade155c9a3f73d8c18bf1b0fe8d1c99885 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Fri, 21 Jun 2024 19:19:37 -0400 Subject: [PATCH] Fix cloud layer CLR --- functions.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/functions.js b/functions.js index 9c23508..95ed41d 100644 --- a/functions.js +++ b/functions.js @@ -393,7 +393,11 @@ const functions = { const interAltim = Math.round((metarData.altim * 0.2952998057228486) * 10) const altim = interAltim / 100; metarData.clouds.forEach(cloudLayer => { - clouds.push(`${cloudLayer.cover} @ ${cloudLayer.base}`); + if (cloudLayer.base !== null) { + clouds.push(`${cloudLayer.cover} @ ${cloudLayer.base}`); + } else { + clouds.push(`${cloudLayer.cover}`); + } }); const embed = new Discord.MessageEmbed() .setAuthor({ name: `${metarData.name} [${metarData.icaoId}] METAR`, iconURL: "https://aviationweather.gov/img/icons/awc-logo-180.png"})