fix "0" reply bug

replaces "in" in for loops to "of"
This commit is contained in:
Wroclaw 2023-07-28 09:26:53 +02:00
parent c7b36885a3
commit 9c3f25312b

View file

@ -280,7 +280,7 @@ async function executeFromQueue(channel: string) {
} }
else { else {
const answerMessagesContent :string[] = [""]; 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) { if (answerMessagesContent[answerMessagesContent.length-1].length + i.length < 2000) {
answerMessagesContent[answerMessagesContent.length-1] += "\n\n" + i; 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 }}); const response = requestReply(message, {content: i}, {allowedMentions: { repliedUser: false }});
response.then(rval => Moderation.checkMessage(rval)); response.then(rval => Moderation.checkMessage(rval));