mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix
This commit is contained in:
@@ -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] });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user