From 8a2238cd8f38e67e14e909e24a9762d938088479 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Mon, 7 Jun 2021 20:39:08 -0400 Subject: [PATCH] Fix --- commands/games-sp/akinator.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/commands/games-sp/akinator.js b/commands/games-sp/akinator.js index b0f2691b..32cd1d61 100644 --- a/commands/games-sp/akinator.js +++ b/commands/games-sp/akinator.js @@ -61,7 +61,7 @@ module.exports = class AkinatorCommand extends Command { } let buttonPress = initialVerify.first(); if (buttonPress.customID === 'false') return buttonPress.update('Too bad...', { components: [] }); - await buttonPress.deferUpdate(); + await this.sendLoadingMessage(buttonPress, [initialRow]); const guessBlacklist = []; this.client.games.set(msg.channel.id, { name: this.name }); while (timesGuessed < 3) { @@ -100,7 +100,7 @@ module.exports = class AkinatorCommand extends Command { break; } buttonPress = interactions.first(); - await buttonPress.deferUpdate(); + await this.sendLoadingMessage(buttonPress, [row, sRow]); const choice = interactions.first().customID; if (choice === 'end') { forceGuess = true; @@ -146,7 +146,7 @@ module.exports = class AkinatorCommand extends Command { break; } buttonPress = verification.first(); - await buttonPress.deferUpdate(); + await this.sendLoadingMessage(buttonPress, [guessRow]); if (buttonPress.customID === 'true') { win = false; break; @@ -173,4 +173,13 @@ module.exports = class AkinatorCommand extends Command { throw err; } } + + sendLoadingMessage(buttonPress, rows) { + for (const row of rows) { + for (const button of row.components) { + button.setDisabled(true); + } + } + return buttonPress.update('Loading...', { components: [rows] }); + } };