From 9c3f25312b4146b5cdf9e9abe8a68eddc72662a4 Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Fri, 28 Jul 2023 09:26:53 +0200 Subject: [PATCH] fix "0" reply bug replaces "in" in for loops to "of" --- src/execution.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/execution.ts b/src/execution.ts index 5982a6f..5ece5a1 100644 --- a/src/execution.ts +++ b/src/execution.ts @@ -280,7 +280,7 @@ async function executeFromQueue(channel: string) { } else { const answerMessagesContent :string[] = [""]; - for (const i in answerContent.split(/\n\n/)) { + for (const i of answerContent.split(/\n\n/)) { if (answerMessagesContent[answerMessagesContent.length-1].length + i.length < 2000) { answerMessagesContent[answerMessagesContent.length-1] += "\n\n" + i; } @@ -289,7 +289,7 @@ async function executeFromQueue(channel: string) { } } - for (const i in answerMessagesContent) { + for (const i of answerMessagesContent) { const response = requestReply(message, {content: i}, {allowedMentions: { repliedUser: false }}); response.then(rval => Moderation.checkMessage(rval));