Showing
1 changed file
with
6 additions
and
3 deletions
... | @@ -82,7 +82,8 @@ function handleEvent(event) { | ... | @@ -82,7 +82,8 @@ 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("!"); | 85 | + client.replyMessage(event.replyToken,event.message.image).then(resolve).catch(reject); |
86 | + /*console.log("!"); | ||
86 | var cheerio = require('cheerio'); | 87 | var cheerio = require('cheerio'); |
87 | 88 | ||
88 | let subscriptionKey = process.env['COMPUTER_VISION_SUBSCRIPTION_KEY']; | 89 | let subscriptionKey = process.env['COMPUTER_VISION_SUBSCRIPTION_KEY']; |
... | @@ -105,7 +106,7 @@ function handleEvent(event) { | ... | @@ -105,7 +106,7 @@ function handleEvent(event) { |
105 | request.post(options, function (error, response, body) { | 106 | request.post(options, function (error, response, body) { |
106 | var data=JSON.stringify(body); | 107 | var data=JSON.stringify(body); |
107 | var text=''; | 108 | var text=''; |
108 | - console.log("data:"+data); | 109 | + console.log(data); |
109 | while(data.indexOf('text\\')!=-1) | 110 | while(data.indexOf('text\\')!=-1) |
110 | { | 111 | { |
111 | data=data.substring(data.indexOf('text\\')+9); | 112 | data=data.substring(data.indexOf('text\\')+9); |
... | @@ -137,7 +138,9 @@ function handleEvent(event) { | ... | @@ -137,7 +138,9 @@ function handleEvent(event) { |
137 | } | 138 | } |
138 | client.replyMessage(event.replyToken,result).then(resolve).catch(reject); | 139 | client.replyMessage(event.replyToken,result).then(resolve).catch(reject); |
139 | }); | 140 | }); |
140 | - }); | 141 | + });*/ |
142 | + | ||
143 | + | ||
141 | 144 | ||
142 | }) | 145 | }) |
143 | } | 146 | } | ... | ... |
-
Please register or login to post a comment