From 2f6b62b13bf495b68ce693ef42138ddd6174434d Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Thu, 18 Apr 2019 17:36:55 +0000 Subject: [PATCH] Attempt to Fix --- commands/games/akinator.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/commands/games/akinator.js b/commands/games/akinator.js index e08e4d8a..a0fe930c 100644 --- a/commands/games/akinator.js +++ b/commands/games/akinator.js @@ -74,6 +74,7 @@ module.exports = class AkinatorCommand extends Command { } async createSession(channel) { + const time = Date.now(); const { body } = await request .get('https://srv13.akinator.com:9196/ws/new_session') .query({ @@ -84,7 +85,7 @@ module.exports = class AkinatorCommand extends Command { constraint: 'ETAT<>\'AV\'', soft_constraint: channel.nsfw ? '' : 'ETAT=\'EN\'', question_filter: channel.nsfw ? '' : 'cat=1', - _: Date.now() + _: time }); if (body.completion !== 'OK') return { data: null, raw: body }; const data = body.parameters; @@ -92,7 +93,8 @@ module.exports = class AkinatorCommand extends Command { id: data.identification.session, signature: data.identification.signature, step: 0, - progression: Number.parseInt(data.step_information.progression, 10) + progression: Number.parseInt(data.step_information.progression, 10), + time }); return { data: data.step_information, raw: body }; } @@ -107,7 +109,7 @@ module.exports = class AkinatorCommand extends Command { step: session.step, answer, question_filter: channel.nsfw ? '' : 'cat=1', - _: Date.now() + _: session.time + 1 }); if (body.completion !== 'OK') return { data: null, raw: body }; const data = body.parameters; @@ -115,7 +117,8 @@ module.exports = class AkinatorCommand extends Command { id: session.id, signature: session.signature, step: Number.parseInt(data.step, 10), - progression: Number.parseInt(data.progression, 10) + progression: Number.parseInt(data.progression, 10), + time: session.time + 1 }); return { data, raw: body }; }