은승우

Update app.js

Showing 1 changed file with 0 additions and 3 deletions
......@@ -82,14 +82,12 @@ async function handleEvent(event) {
}
else if (event.type == 'message'&& event.message.type == 'image') {
return new Promise(async(resolve,reject)=>{
var file;
await client.getMessageContent(event.message.id)
.then(
async(stream) => {
await stream.on('data', (chunk) => {
fs.writeFileSync('./photo/1.png',chunk);
console.log(file);
var cheerio = require('cheerio');
var uriBase = 'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr';
var options = {
......@@ -114,7 +112,6 @@ async function handleEvent(event) {
text+=data.substring(0,data.indexOf("\\"))+" ";
}
text="나의모든날들";
console.log(text);
var url="https://www.genie.co.kr/search/searchLyrics?query="+ encodeURI(text);
request(url, function(error, response, html){
var $ = cheerio.load(html);
......