make weather command return if an error occured

This commit is contained in:
FLGX 2020-03-19 10:46:53 +01:00
parent a411fb3af4
commit e5aad749f5
No known key found for this signature in database
GPG key ID: 999D16475015DDE3

View file

@ -13,7 +13,7 @@ exports.run = async (client, message, args, error) => {
message.channel.startTyping();
weather.find({search: args.join(" "), degreeType: 'C'}, function(err, result) {
if(err) client.logger.log(`weather.js error: ${JSON.stringify(error)}`, "error")
if(err) return client.logger.log(`weather.js error: ${JSON.stringify(error)}`, "error")
if(result.length < 2 || !result) {
message.channel.stopTyping();
return message.channel.send("<:error:466995152976871434> City not found!");