Minty U

OCR Implement

1 +const Tesseract = require("tesseract.js");
1 exports.run = async (client, msg, args, prefix) => { 2 exports.run = async (client, msg, args, prefix) => {
2 - msg.channel.send(`${client.user.username}의 핑은 ${client.ws.ping}ms 입니다!`); 3 + // msg.channel.send(`${client.user.username}의 핑은 ${client.ws.ping}ms 입니다!`);
4 + if (msg.attachments.size > 0) {
5 + msg.attachments.forEach(attachment => {
6 + var ImgURL = attachment.proxyURL;
7 + Tesseract.recognize(
8 + ImgURL,
9 + "eng",
10 + { logger: (m) => console.log(m) }
11 + ).then(({ data: { text } }) => {
12 + // Replying with the extracted test
13 + console.log(text);
14 + msg.reply(text);
15 + });
16 +
17 + });
18 + }
3 }; 19 };
4 20
5 exports.config = { 21 exports.config = {
......
This file is too large to display.