은승우

Update app.js

Showing 1 changed file with 4 additions and 5 deletions
......@@ -83,15 +83,14 @@ async function handleEvent(event) {
else if (event.type == 'message'&& event.message.type == 'image') {
return new Promise(async(resolve,reject)=>{
var file;
while(file!=undefined)
{
client.getMessageContent(event.message.id)
.then((stream) => {
stream.on('data', (chunk) => {
.then(async(stream) => {
await stream.on('data', (chunk) => {
file=chunk;
});
});
}
var cheerio = require('cheerio');
var uriBase = 'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr';
var options = {
......