Showing
1 changed file
with
3 additions
and
2 deletions
... | @@ -83,14 +83,15 @@ async function handleEvent(event) { | ... | @@ -83,14 +83,15 @@ async function handleEvent(event) { |
83 | else if (event.type == 'message'&& event.message.type == 'image') { | 83 | else if (event.type == 'message'&& event.message.type == 'image') { |
84 | return new Promise(async(resolve,reject)=>{ | 84 | return new Promise(async(resolve,reject)=>{ |
85 | var file; | 85 | var file; |
86 | + while(file!=undefined) | ||
87 | + { | ||
86 | client.getMessageContent(event.message.id) | 88 | client.getMessageContent(event.message.id) |
87 | .then((stream) => { | 89 | .then((stream) => { |
88 | stream.on('data', (chunk) => { | 90 | stream.on('data', (chunk) => { |
89 | file=chunk; | 91 | file=chunk; |
90 | }); | 92 | }); |
91 | }); | 93 | }); |
92 | - | 94 | + } |
93 | - console.log(file); | ||
94 | var cheerio = require('cheerio'); | 95 | var cheerio = require('cheerio'); |
95 | var uriBase = 'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr'; | 96 | var uriBase = 'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr'; |
96 | var options = { | 97 | var options = { | ... | ... |
-
Please register or login to post a comment