From a5ac364c74bb6198f193a9e1057345bf2cbc9838 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 31 Mar 2024 12:15:51 -0400 Subject: [PATCH] Fix? --- commands/games-sp/20-questions.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/commands/games-sp/20-questions.js b/commands/games-sp/20-questions.js index 333c8a7f..81e09588 100644 --- a/commands/games-sp/20-questions.js +++ b/commands/games-sp/20-questions.js @@ -59,13 +59,14 @@ module.exports = class TwentyQuestionsCommand extends Command { } await this.sendLoadingMessage(buttonPress, [initialRow]); while (win === null) { - const answers = question.answers.map(answer => answer.text.toLowerCase()); + const answers = question.answers.map(answer => answer.text); const rowCount = Math.ceil(answers.length / 5); const rows = []; for (let i = 0; i <= rowCount; i++) rows.push(new MessageActionRow()); for (let i = 0; i < answers.length; i++) { const answer = answers[i]; const row = rows[i % 5]; + if (!row) continue; row.addComponents(new MessageButton().setCustomId(answer).setStyle('PRIMARY').setLabel(answer)); } const sRow = new MessageActionRow(); @@ -84,7 +85,7 @@ module.exports = class TwentyQuestionsCommand extends Command { win = 'time'; break; } - await this.sendLoadingMessage(buttonPress, [row, sRow]); + await this.sendLoadingMessage(buttonPress, [...rows, sRow]); const choice = buttonPress.customId; if (choice === 'end') { win = 'time';