|
|
@ -209,7 +209,7 @@ function getMatchingPhrase(inputString, targetCharacter) {
|
|
|
|
(async () => {
|
|
|
|
(async () => {
|
|
|
|
// Does the message have an attachment? Check the attachment with OCR
|
|
|
|
// Does the message have an attachment? Check the attachment with OCR
|
|
|
|
console.log(message.attachments);
|
|
|
|
console.log(message.attachments);
|
|
|
|
if (message.attachments.contentType.contains("image")) {
|
|
|
|
if (message.attachments.contentType.includes("image")) {
|
|
|
|
const worker = await createWorker('eng');
|
|
|
|
const worker = await createWorker('eng');
|
|
|
|
const ret = await worker.recognize(message.attachments.proxyURL);
|
|
|
|
const ret = await worker.recognize(message.attachments.proxyURL);
|
|
|
|
console.log("OCR Results: " + ret.data.text);
|
|
|
|
console.log("OCR Results: " + ret.data.text);
|
|
|
|