This commit is contained in:
Dragon Fire
2020-11-09 18:00:21 -05:00
parent fd756459a0
commit e37f658efd
+1
View File
@@ -35,6 +35,7 @@ module.exports = class AcrosticCommand extends Command {
run(msg, { word }) {
const results = [];
for (const letter of word) {
if (letter === ' ') results.push(' ');
const filteredWords = words.filter(wrd => wrd.startsWith(letter.toLowerCase()));
const chosen = filteredWords[Math.floor(Math.random() * filteredWords.length)];
results.push(`**${letter.toUpperCase()}**${chosen.slice(1)}`);