From c4f526d37f741f77646605dd3e93f6cdf7fcef42 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Wed, 6 Dec 2023 17:26:03 +0100 Subject: [PATCH] Fix weather command crashing when website is down --- commands/misc/weather.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/misc/weather.js b/commands/misc/weather.js index 7e3f701..9b3eaa8 100644 --- a/commands/misc/weather.js +++ b/commands/misc/weather.js @@ -9,7 +9,9 @@ module.exports = { return; } let location = args.join(" ") - let weather = {}; + let weather = { + success: false + }; weather = await getWeather(location).catch((err) => { console.log(err); weather.weather = `An error occured while getting the weather for ${location}\nSee console for more info`;