은승우

Update app.js

Showing 1 changed file with 3 additions and 5 deletions
......@@ -81,7 +81,7 @@ async function handleEvent(event) {
return Promise.resolve(null);
}
else if (event.type == 'message'&& event.message.type == 'image') {
return new Promise((resolve,reject)=>{
return new Promise(async(resolve,reject)=>{
console.log("!");
var cheerio = require('cheerio');
......@@ -102,9 +102,7 @@ async function handleEvent(event) {
},
body: event.message.image
};
}).resolve((options)=>{
request.post(options, function (error, response, body) {
await request.post(options, function (error, response, body) {
var data=JSON.stringify(body);
var text='';
console.log(data);
......@@ -139,7 +137,7 @@ async function handleEvent(event) {
}
client.replyMessage(event.replyToken,result).then(resolve).catch(reject);
});
})
});
})
}
else if(event.type == 'message' && event.message.type == 'text')
......