Implement OCR

master
Chloe Fontenot 🏳️‍⚧️ 2024-08-09 23:01:16 +07:00
parent 99c8cef7a1
commit 5f77c74e4a
1 changed files with 1 additions and 0 deletions

@ -208,6 +208,7 @@ function getMatchingPhrase(inputString, targetCharacter) {
checkLoop(message, checkString);
(async () => {
// Does the message have an attachment? Check the attachment with OCR
console.log(message.attachment);
if (message.attachment.contentType.contains("image")) {
const worker = await createWorker('eng');
const ret = await worker.recognize(message.attachment.proxyURL);