Showing
1 changed file
with
2 additions
and
16 deletions
... | @@ -82,21 +82,7 @@ function handleEvent(event) { | ... | @@ -82,21 +82,7 @@ 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 | - client.getMessageContent(event.message.id).then((stream) => { | 85 | + console.log("!"); |
86 | - stream.on('data', (chunk) => { | ||
87 | - request.post( function(error, response, body){ | ||
88 | - // Translate API Sucess | ||
89 | - if(!error && response.statusCode == 200){ | ||
90 | - client.replyMessage(event.replyToken,chunk).then(resolve).catch(reject); | ||
91 | - } | ||
92 | - }); | ||
93 | - stream.on('error', (err) => { | ||
94 | - // error handling | ||
95 | - }); | ||
96 | - }); | ||
97 | - | ||
98 | - }); | ||
99 | - /*console.log("!"); | ||
100 | var cheerio = require('cheerio'); | 86 | var cheerio = require('cheerio'); |
101 | 87 | ||
102 | let subscriptionKey = process.env['COMPUTER_VISION_SUBSCRIPTION_KEY']; | 88 | let subscriptionKey = process.env['COMPUTER_VISION_SUBSCRIPTION_KEY']; |
... | @@ -151,7 +137,7 @@ function handleEvent(event) { | ... | @@ -151,7 +137,7 @@ function handleEvent(event) { |
151 | } | 137 | } |
152 | client.replyMessage(event.replyToken,result).then(resolve).catch(reject); | 138 | client.replyMessage(event.replyToken,result).then(resolve).catch(reject); |
153 | }); | 139 | }); |
154 | - });*/ | 140 | + }); |
155 | }) | 141 | }) |
156 | } | 142 | } |
157 | else if(event.type == 'message' && event.message.type == 'text') | 143 | else if(event.type == 'message' && event.message.type == 'text') | ... | ... |
-
Please register or login to post a comment