This commit is contained in:
Dragon Fire
2024-03-24 21:23:31 -04:00
parent f5df89899e
commit f1e311cfae
+3 -1
View File
@@ -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)]}`;
}
};