From f1e311cfaeebd88b3b7739a2c49600ce831a015e Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 24 Mar 2024 21:23:31 -0400 Subject: [PATCH] Fix --- commands/edit-text/yoda.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/edit-text/yoda.js b/commands/edit-text/yoda.js index 06c4a881..8a33f4d5 100644 --- a/commands/edit-text/yoda.js +++ b/commands/edit-text/yoda.js @@ -53,7 +53,9 @@ module.exports = class YodaCommand extends Command { const split = sentence.split(' '); return split.map((word, i) => i === 0 || word === 'i' ? firstUpperCase(word) : word).join(' '); }); - if (newSentences.length === 1) newSentences.push('.'); + if (newSentences.length === 1) { + return `${newSentences.join('. ').trim()}. ${ends[Math.floor(Math.random() * ends.length)]}`; + } return `${newSentences.join('. ').trim()} ${ends[Math.floor(Math.random() * ends.length)]}`; } };