This commit is contained in:
Cedric Hoelzl 2019-09-20 12:42:17 +02:00
parent 51d5041ac1
commit 3e9653b9cf

View File

@ -34,13 +34,17 @@ module.exports = function(url, cmds){
};
return new Promise((resolve,reject)=>{
return request.get(options, function (err, response, body) {
if (err)
if (err) {
bot.error(err);
return reject(500);
}
if (response.statusCode != 200 )
if (response.statusCode != 200 ){
bot.error(response.statusCode);
return reject(500);//response.statusCode);
}
event.reply(body.reply).catch(err=>bot.error(500));
event.reply(body.reply).catch(err=>bot.error(err));
return resolve(200);
});