mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-06 14:20:51 +02:00
Retry once if akinator fails a step
This commit is contained in:
@@ -46,8 +46,15 @@ module.exports = class AkinatorCommand extends Command {
|
||||
let forceGuess = false;
|
||||
this.client.games.set(msg.channel.id, { name: this.name });
|
||||
while (timesGuessed < 3) {
|
||||
if (ans === null) await aki.start();
|
||||
else await aki.step(ans);
|
||||
if (ans === null) {
|
||||
await aki.start();
|
||||
} else {
|
||||
try {
|
||||
await aki.step(ans);
|
||||
} catch {
|
||||
await aki.step(ans);
|
||||
}
|
||||
}
|
||||
if (!aki.answers || aki.currentStep >= 78) forceGuess = true;
|
||||
const answers = aki.answers.map(answer => answer.toLowerCase());
|
||||
answers.push('end');
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "114.16.3",
|
||||
"version": "114.16.4",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user