은승우

Update app.js

Showing 1 changed file with 9 additions and 7 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 - await stream.on('data', (chunk) => { 89 + async(stream) => {
90 - file=chunk; 90 + await stream.on('data', (chunk) => {
91 - console.log(chunk); 91 + file = chunk;
92 - }); 92 + console.log(chunk);
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';
......