jgoralcz / aki-api

An API for the Akinator in Node. Supports up to 15 languages.
MIT License
116 stars 39 forks source link

win is undefined #156

Open pumpa0 opened 6 months ago

pumpa0 commented 6 months ago

I'm using version 7.0.0, and win is undefined. there are 13 steps, and the progress is 92%

WillTDA commented 6 months ago

Aki.win() is no longer part of the API. One solution would be to check if a guess has been made by checking the existence of aki.guess?.id_base_proposition. Still don't fully understand why it was taken out, it made updating from v6 a pain.

FebriansyahXd commented 6 months ago

you can use aki.guess != undefined, but that will require him to achieve a score of 100%

AliyulManan123 commented 6 months ago

same

Salientekill commented 6 months ago

you can use aki.guess != undefined, but that will require him to achieve a score of 100%

What would the code look like using this?

FebriansyahXd commented 6 months ago

you can use aki.guess != undefined, but that will require him to achieve a score of 100%

What would the code look like using this?

if (aki.guess != undefined){ return aki.guess.name_proposition }
if u wan fill code i will give u

Salientekill commented 6 months ago

you can use aki.guess != undefined, but that will require him to achieve a score of 100%

What would the code look like using this?

if (aki.guess != undefined){ return aki.guess.name_proposition } if u wan fill code i will give u

My code:

await aki.step(args) if (aki.progress >= 90 || aki.currentStep >= 90) { await aki.win() jogo.now = true bui3 = { "1": ${prefix}fimaki sim, "2": ${prefix}fimaki não } optionscmd[from] = { sender: sender, time: Date.now()+30000, comandos: bui3 } fs.writeFileSync("./DADOS/json/optionscmd.json", JSON.stringify(optionscmd, null, 2)) conn.sendMessage(from, { image: { url: aki.answers[0].absolute_picture_path }, caption: aki.answers[0].name + ": " + aki.answers[0].description + \nPor acaso este é o seu personagem?\n\n*Opções:* *1 - Sim* *2 - Não*}) }

FebriansyahXd commented 6 months ago

you can use aki.guess != undefined, but that will require him to achieve a score of 100%

What would the code look like using this?

if (aki.guess != undefined){ return aki.guess.name_proposition } if u wan fill code i will give u

My code:

await aki.step(args) if (aki.progress >= 90 || aki.currentStep >= 90) { await aki.win() jogo.now = true bui3 = { "1": ${prefix}fimaki sim, "2": ${prefix}fimaki não } optionscmd[from] = { sender: sender, time: Date.now()+30000, comandos: bui3 } fs.writeFileSync("./DADOS/json/optionscmd.json", JSON.stringify(optionscmd, null, 2)) conn.sendMessage(from, { image: { url: aki.answers[0].absolute_picture_path }, caption: aki.answers[0].name + ": " + aki.answers[0].description + \nPor acaso este é o seu personagem?\n\n*Opções:* *1 - Sim* *2 - Não*}) }

are u make WhatsApp bot? sure i can help

first u wan to delete the function of if (aki.progress >= 90 || aki.currentStep >= 90)

you have to change it so

if (aki.guess != undefined) {

console.log(aki.guess) // u Can find image + answer }

and to see the image of the answer u can find aki.guess if the game has been won

if u want help more chat DM on Instagram febriann_syh or Facebook Febriansyah

Salientekill commented 6 months ago

you can use aki.guess != undefined, but that will require him to achieve a score of 100%

What would the code look like using this?

if (aki.guess != undefined){ return aki.guess.name_proposition } if u wan fill code i will give u

My code: await aki.step(args) if (aki.progress >= 90 || aki.currentStep >= 90) { await aki.win() jogo.now = true bui3 = { "1": ${prefix}fimaki sim, "2": ${prefix}fimaki não } optionscmd[from] = { sender: sender, time: Date.now()+30000, comandos: bui3 } fs.writeFileSync("./DADOS/json/optionscmd.json", JSON.stringify(optionscmd, null, 2)) conn.sendMessage(from, { image: { url: aki.answers[0].absolute_picture_path }, caption: aki.answers[0].name + ": " + aki.answers[0].description + \nPor acaso este é o seu personagem?\n\n*Opções:* *1 - Sim* *2 - Não*}) }

are u make WhatsApp bot? sure i can help

first u wan to delete the function of if (aki.progress >= 90 || aki.currentStep >= 90)

you have to change it so

if (aki.guess != undefined) {

console.log(aki.guess) // u Can find image + answer }

and to see the image of the answer u can find aki.guess if the game has been won

if u want help more chat DM on Instagram febriann_syh or Facebook Febriansyah

Obrigado

FebriansyahXd commented 6 months ago

same issues here, how fix?

just copy just copy what I have shared, i u want to help more klik it https://tinyurl.com/2s4jmvkv