Fix cloud layer CLR

This commit is contained in:
Skylar Grant 2024-06-21 19:19:37 -04:00
parent 13553d7e5a
commit 5a9b91ade1

View File

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