은승우

Update app.js

Showing 1 changed file with 6 additions and 4 deletions
...@@ -84,13 +84,15 @@ async function handleEvent(event) { ...@@ -84,13 +84,15 @@ async function handleEvent(event) {
84 return new Promise(async(resolve,reject)=>{ 84 return new Promise(async(resolve,reject)=>{
85 var file; 85 var file;
86 86
87 - client.getMessageContent(event.message.id) 87 + await client.getMessageContent(event.message.id)
88 - .then(async(stream) => { 88 + .then(
89 + async(stream) => {
89 await stream.on('data', (chunk) => { 90 await stream.on('data', (chunk) => {
90 - file=chunk; 91 + file = chunk;
91 console.log(chunk); 92 console.log(chunk);
92 }); 93 });
93 - }); 94 + }
95 + );
94 console.log(file); 96 console.log(file);
95 var cheerio = require('cheerio'); 97 var cheerio = require('cheerio');
96 var uriBase = 'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr'; 98 var uriBase = 'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr';
......