diff --git a/commands/games-sp/20-questions.js b/commands/games-sp/20-questions.js index 81e09588..b9b5f0ad 100644 --- a/commands/games-sp/20-questions.js +++ b/commands/games-sp/20-questions.js @@ -2,7 +2,6 @@ const Command = require('../../framework/Command'); const { MessageButton, MessageActionRow } = require('discord.js'); const request = require('node-superfetch'); const cheerio = require('cheerio'); -const { stripIndents } = require('common-tags'); const { list } = require('../../util/Util'); const games = require('../../assets/json/20-questions'); @@ -65,8 +64,7 @@ module.exports = class TwentyQuestionsCommand extends Command { 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; + const row = rows[Math.floor(i / 5)]; row.addComponents(new MessageButton().setCustomId(answer).setStyle('PRIMARY').setLabel(answer)); } const sRow = new MessageActionRow(); @@ -98,11 +96,8 @@ module.exports = class TwentyQuestionsCommand extends Command { break; } } - if (win === 'time') return msg.say('Game ended due to forfeit.'); - return msg.say(stripIndents` - **${question.winText}** - ${question.result} - `); + if (win === 'time') return buttonPress.editReply({ content: 'Game ended due to forfeit.' }); + return buttonPress.editReply({ content: `**${question.winText}**\n${question.result}` }); } makeBaseURI(game) {