From e68149d12015bef5c211200e38e2e03f7871112f Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 31 Mar 2024 12:26:02 -0400 Subject: [PATCH] Fix --- commands/games-sp/20-questions.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/games-sp/20-questions.js b/commands/games-sp/20-questions.js index b9b5f0ad..8366a051 100644 --- a/commands/games-sp/20-questions.js +++ b/commands/games-sp/20-questions.js @@ -62,9 +62,11 @@ module.exports = class TwentyQuestionsCommand extends Command { const rowCount = Math.ceil(answers.length / 5); const rows = []; for (let i = 0; i <= rowCount; i++) rows.push(new MessageActionRow()); + let rowi = 0; for (let i = 0; i < answers.length; i++) { const answer = answers[i]; - const row = rows[Math.floor(i / 5)]; + if (rows[rowi].components.length > 5) rowi++; + const row = rows[rowi]; row.addComponents(new MessageButton().setCustomId(answer).setStyle('PRIMARY').setLabel(answer)); } const sRow = new MessageActionRow();