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; + } })(); } });