From 6deab1ec12667e7d38d2c061430247040663ecf6 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 31 Mar 2024 12:35:45 -0400 Subject: [PATCH] Fix --- commands/games-sp/20-questions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/games-sp/20-questions.js b/commands/games-sp/20-questions.js index c731f7cb..229c3c42 100644 --- a/commands/games-sp/20-questions.js +++ b/commands/games-sp/20-questions.js @@ -61,9 +61,9 @@ module.exports = class TwentyQuestionsCommand extends Command { 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 < rowCount; i++) rows.push(new MessageActionRow()); for (let i = 0; i < answers.length; i += 5) { - const row = rows[i]; + const row = rows[Math.floor(i / 5)]; const components = answers.slice(i, i + 5); for (const component of components) { row.addComponents(new MessageButton().setCustomId(component).setStyle('PRIMARY').setLabel(component));