mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-16 08:22:22 +02:00
Fix akinator not ending at question 80
This commit is contained in:
@@ -36,15 +36,12 @@ module.exports = class AkinatorCommand extends Command {
|
|||||||
while (timesGuessed < 3) {
|
while (timesGuessed < 3) {
|
||||||
if (ans === null) await aki.start();
|
if (ans === null) await aki.start();
|
||||||
else await aki.step(ans);
|
else await aki.step(ans);
|
||||||
if (!aki.answers || aki.currentStep >= 80) {
|
if (!aki.answers || aki.currentStep >= 79) forceGuess = true;
|
||||||
forceGuess = true;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
const answers = aki.answers.map(answer => answer.toLowerCase());
|
const answers = aki.answers.map(answer => answer.toLowerCase());
|
||||||
answers.push('end');
|
answers.push('end');
|
||||||
await msg.say(stripIndents`
|
await msg.say(stripIndents`
|
||||||
**${++aki.currentStep + 1}.** ${aki.question} (${Math.round(Number.parseInt(aki.progress, 10))}%)
|
**${++aki.currentStep + 1}.** ${aki.question} (${Math.round(Number.parseInt(aki.progress, 10))}%)
|
||||||
${aki.answers.join(' | ')}
|
${aki.answers.join(' | ')} | End
|
||||||
`);
|
`);
|
||||||
const filter = res => res.author.id === msg.author.id && answers.includes(res.content.toLowerCase());
|
const filter = res => res.author.id === msg.author.id && answers.includes(res.content.toLowerCase());
|
||||||
const msgs = await msg.channel.awaitMessages(filter, {
|
const msgs = await msg.channel.awaitMessages(filter, {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "114.16.0",
|
"version": "114.16.1",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user