From 5d79b3feaeb5d3568193303c193d108475d99904 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Thu, 18 Oct 2018 16:59:56 +0000 Subject: [PATCH] Fix akinator --- .env.example | 1 - commands/games/akinator.js | 20 ++++++++------------ package.json | 2 +- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.env.example b/.env.example index 9acc75ad..240e6cf0 100644 --- a/.env.example +++ b/.env.example @@ -20,7 +20,6 @@ SUCCESS_EMOJI_ID= SUCCESS_EMOJI_NAME= # API Keys, IDs, and Secrets -AKINATOR_UID= ALPHA_VANTAGE_KEY= CUSTOM_SEARCH_ID= DEVIANTART_ID= diff --git a/commands/games/akinator.js b/commands/games/akinator.js index a275803b..756026eb 100644 --- a/commands/games/akinator.js +++ b/commands/games/akinator.js @@ -3,7 +3,6 @@ const { MessageEmbed } = require('discord.js'); const request = require('node-superfetch'); const { stripIndents } = require('common-tags'); const { verify } = require('../../util/Util'); -const { AKINATOR_UID } = process.env; module.exports = class AkinatorCommand extends Command { constructor(client) { @@ -66,16 +65,15 @@ module.exports = class AkinatorCommand extends Command { async createSession(channel) { const { body } = await request - .get('https://srv2.akinator.com:9157/ws/new_session') + .get('https://srv6.akinator.com:9126/ws/new_session') .query({ - partner: 1, + partner: '', player: 'website-desktop', - uid_ext_session: AKINATOR_UID, + uid_ext_session: '', frontaddr: 'MTc4LjMzLjIzMS45OA==', constraint: 'ETAT<>\'AV\'', soft_constraint: channel.nsfw ? '' : 'ETAT=\'EN\'', - question_filter: channel.nsfw ? '' : 'cat=1', - _: Date.now() + question_filter: channel.nsfw ? '' : 'cat=1' }); if (body.completion !== 'OK') return null; const data = body.parameters; @@ -91,14 +89,13 @@ module.exports = class AkinatorCommand extends Command { async progress(channel, answer) { const session = this.sessions.get(channel.id); const { body } = await request - .get('https://srv2.akinator.com:9157/ws/answer') + .get('https://srv6.akinator.com:9126/ws/answer') .query({ session: session.id, signature: session.signature, step: session.step, answer, - question_filter: channel.nsfw ? '' : 'cat=1', - _: Date.now() + question_filter: channel.nsfw ? '' : 'cat=1' }); if (body.completion !== 'OK') return null; const data = body.parameters; @@ -114,7 +111,7 @@ module.exports = class AkinatorCommand extends Command { async guess(channel) { const session = this.sessions.get(channel.id); const { body } = await request - .get('https://srv2.akinator.com:9157/ws/list') + .get('https://srv6.akinator.com:9126/ws/list') .query({ session: session.id, signature: session.signature, @@ -124,8 +121,7 @@ module.exports = class AkinatorCommand extends Command { max_pic_height: 294, pref_photos: 'VO-OK', duel_allowed: 1, - mode_question: 0, - _: Date.now() + mode_question: 0 }); if (body.completion !== 'OK') return null; return body.parameters.elements[0].element; diff --git a/package.json b/package.json index f304d215..6b397be3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "95.1.6", + "version": "95.1.7", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {