diff --git a/.env.example b/.env.example index 240e6cf0..9acc75ad 100644 --- a/.env.example +++ b/.env.example @@ -20,6 +20,7 @@ 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 a17a7e60..a275803b 100644 --- a/commands/games/akinator.js +++ b/commands/games/akinator.js @@ -3,12 +3,13 @@ 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) { super(client, { name: 'akinator', - aliases: ['the-web-genie', 'web-genie'], + aliases: ['the-web-genie', 'web-genie', 'aki'], group: 'games', memberName: 'akinator', description: 'Think about a real or fictional character, I will try to guess who it is.', @@ -69,15 +70,15 @@ module.exports = class AkinatorCommand extends Command { .query({ partner: 1, player: 'website-desktop', - uid_ext_session: '5ba118d44e469', + uid_ext_session: AKINATOR_UID, frontaddr: 'MTc4LjMzLjIzMS45OA==', constraint: 'ETAT<>\'AV\'', soft_constraint: channel.nsfw ? '' : 'ETAT=\'EN\'', question_filter: channel.nsfw ? '' : 'cat=1', _: Date.now() }); + if (body.completion !== 'OK') return null; const data = body.parameters; - if (!data) return null; this.sessions.set(channel.id, { id: data.identification.session, signature: data.identification.signature, @@ -99,8 +100,8 @@ module.exports = class AkinatorCommand extends Command { question_filter: channel.nsfw ? '' : 'cat=1', _: Date.now() }); + if (body.completion !== 'OK') return null; const data = body.parameters; - if (!data) return null; this.sessions.set(channel.id, { id: session.id, signature: session.signature, @@ -126,7 +127,7 @@ module.exports = class AkinatorCommand extends Command { mode_question: 0, _: Date.now() }); - if (!body.parameters) return null; + if (body.completion !== 'OK') return null; return body.parameters.elements[0].element; } }; diff --git a/package.json b/package.json index f986e363..f304d215 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "95.1.5", + "version": "95.1.6", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {