fix
This commit is contained in:
parent
51d5041ac1
commit
3e9653b9cf
10
config.js
10
config.js
@ -34,13 +34,17 @@ module.exports = function(url, cmds){
|
|||||||
};
|
};
|
||||||
return new Promise((resolve,reject)=>{
|
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) {
|
||||||
|
bot.error(err);
|
||||||
return reject(500);
|
return reject(500);
|
||||||
|
}
|
||||||
|
|
||||||
if (response.statusCode != 200 )
|
if (response.statusCode != 200 ){
|
||||||
|
bot.error(response.statusCode);
|
||||||
return reject(500);//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);
|
return resolve(200);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user