은승우

Update app.js

Showing 1 changed file with 2 additions and 16 deletions
......@@ -82,21 +82,7 @@ function handleEvent(event) {
}
else if (event.type == 'message'&& event.message.type == 'image') {
return new Promise((resolve,reject)=>{
client.getMessageContent(event.message.id).then((stream) => {
stream.on('data', (chunk) => {
request.post( function(error, response, body){
// Translate API Sucess
if(!error && response.statusCode == 200){
client.replyMessage(event.replyToken,chunk).then(resolve).catch(reject);
}
});
stream.on('error', (err) => {
// error handling
});
});
});
/*console.log("!");
console.log("!");
var cheerio = require('cheerio');
let subscriptionKey = process.env['COMPUTER_VISION_SUBSCRIPTION_KEY'];
......@@ -151,7 +137,7 @@ function handleEvent(event) {
}
client.replyMessage(event.replyToken,result).then(resolve).catch(reject);
});
});*/
});
})
}
else if(event.type == 'message' && event.message.type == 'text')
......