From 3ad5e2af1384eca4b36073b14e5613893804599e Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Fri, 22 May 2020 00:58:26 -0400 Subject: [PATCH] Fix --- commands/random-res/lorem-ipsum.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/commands/random-res/lorem-ipsum.js b/commands/random-res/lorem-ipsum.js index 6b02dd0c..1bf980c7 100644 --- a/commands/random-res/lorem-ipsum.js +++ b/commands/random-res/lorem-ipsum.js @@ -36,13 +36,13 @@ module.exports = class LoremIpsumCommand extends Command { result[result.length - 1] = '.'; for (let i = 0; i < characters - resultLength; i++) { const allowedI = []; - result.forEach((item, i) => { - if (result[i + 1] === '. ') return; - if (result[i] === ' ') return; - if (result[i] === '. ') return; - if (i === result.length - 1) return; - if (result[i].endsWith(',')) return; - allowedI.push(i); + result.forEach((item, j) => { + if (result[j + 1] === '. ') return; + if (result[j] === ' ') return; + if (result[j] === '. ') return; + if (j === result.length - 1) return; + if (result[j].endsWith(',')) return; + allowedI.push(j); }); const chosenI = allowedI[Math.floor(Math.random() * allowedI.length)]; const insertPoint = result[chosenI];