From 28bd2f46cb63b2840e415a93abadb181d93b5379 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Thu, 26 Sep 2024 19:55:12 -0400 Subject: [PATCH] added a response for when nothing gets returned from the API --- dot-commands/metar.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dot-commands/metar.js b/dot-commands/metar.js index 33207e9..b5333e3 100644 --- a/dot-commands/metar.js +++ b/dot-commands/metar.js @@ -10,6 +10,10 @@ module.exports = { // Also checks for validity of ICAOs const icaoList = fn.avWx.parseICAOs(commandData); const metarData = await fn.avWx.metar.getData(icaoList); + if (metarData.length === 0) { + message.reply('No METAR data found for the provided ICAOs.'); + return; + } const messages = fn.avWx.metar.parseData(metarData); messages.forEach(messagePayload => { message.reply(messagePayload);