Fix weather command crashing when website is down

This commit is contained in:
SileNce5k 2023-12-06 17:26:03 +01:00
parent 95702b6ea9
commit c4f526d37f
No known key found for this signature in database
GPG key ID: 961132EB78C8915F

View file

@ -9,7 +9,9 @@ module.exports = {
return; return;
} }
let location = args.join(" ") let location = args.join(" ")
let weather = {}; let weather = {
success: false
};
weather = await getWeather(location).catch((err) => { weather = await getWeather(location).catch((err) => {
console.log(err); console.log(err);
weather.weather = `An error occured while getting the weather for ${location}\nSee console for more info`; weather.weather = `An error occured while getting the weather for ${location}\nSee console for more info`;