This commit is contained in:
Cedric Hoelzl 2019-09-20 12:35:13 +02:00
parent 7dbfc6c382
commit 51d5041ac1

View File

@ -32,16 +32,19 @@ module.exports = function(url, cmds){
url: this.url, url: this.url,
form:message, form:message,
}; };
return new Promise((resolve,reject)=>{
return request.get(options, function (err, response, body) { return request.get(options, function (err, response, body) {
if (err) if (err)
return bot.error(err); return reject(500);
if (response.statusCode != 200 ) if (response.statusCode != 200 )
return bot.error(response.statusCode); return reject(500);//response.statusCode);
return event.reply(body.reply); event.reply(body.reply).catch(err=>bot.error(500));
return resolve(200);
}); });
});
} }
}, },
], ],