은승우

Update app.js

Showing 1 changed file with 7 additions and 2 deletions
...@@ -82,8 +82,13 @@ function handleEvent(event) { ...@@ -82,8 +82,13 @@ function handleEvent(event) {
82 } 82 }
83 else if (event.type == 'message'&& event.message.type == 'image') { 83 else if (event.type == 'message'&& event.message.type == 'image') {
84 return new Promise((resolve,reject)=>{ 84 return new Promise((resolve,reject)=>{
85 - console.log(event.message.originContentUrl); 85 + request.post(options, function(error, response, body){
86 - client.replyMessage(event.replyToken,event.message).then(resolve).catch(reject); 86 + // Translate API Sucess
87 + if(!error && response.statusCode == 200){
88 +
89 + client.replyMessage(event.replyToken,event.message.originalContentUrl).then(resolve).catch(reject);
90 + }
91 + });
87 /*console.log("!"); 92 /*console.log("!");
88 var cheerio = require('cheerio'); 93 var cheerio = require('cheerio');
89 94
......