ocr.js 841 Bytes
const Tesseract = require("tesseract.js");
exports.run = async (client, msg, args, prefix) => {
    // msg.channel.send(`${client.user.username}의 핑은 ${client.ws.ping}ms 입니다!`);
    if (msg.attachments.size > 0) {
        msg.attachments.forEach(attachment => {
            var ImgURL = attachment.proxyURL;
            Tesseract.recognize(
                ImgURL,
                "eng",
                { logger: (m) => console.log(m) }
            ).then(({ data: { text } }) => {
                // Replying with the extracted test
                console.log(text);
                msg.reply(text);
            });

        });
    }
};

exports.config = {
    name: '핑',
    aliases: ['vld', 'ping'],
    category: ['ocr'],
    des: ['봇의 디스코드 웹소켓 지연시간을 알려드립니다'],
    use: ['!핑']
};