From b58e7ff5649118ed6f8a2c3cd1f8428e119f4c19 Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Fri, 9 Aug 2024 23:23:38 -0500 Subject: [PATCH] Implement OCR --- main.cjs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.cjs b/main.cjs index 2aebb5e..20164ed 100644 --- a/main.cjs +++ b/main.cjs @@ -205,7 +205,9 @@ function getMatchingPhrase(inputString, targetCharacter) { return; } checkString = checkString.replace(/[^a-zA-Z0-9]/g, ''); - checkLoop(message, checkString); + if (checkLoop(message, checkString)) { + return; + } // Does the message have an attachment? Check the attachment with OCR console.log(message.attachments); message.attachments.forEach(i => { @@ -221,7 +223,9 @@ function getMatchingPhrase(inputString, targetCharacter) { return; } checkString = checkString.replace(/[^a-zA-Z0-9]/g, ''); - checkLoop(message, checkString); + if (checkLoop(message, checkString)) { + return; + } })(); } });