mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 14:00:22 +02:00
Akinator improvements
This commit is contained in:
@@ -20,6 +20,7 @@ SUCCESS_EMOJI_ID=
|
|||||||
SUCCESS_EMOJI_NAME=
|
SUCCESS_EMOJI_NAME=
|
||||||
|
|
||||||
# API Keys, IDs, and Secrets
|
# API Keys, IDs, and Secrets
|
||||||
|
AKINATOR_UID=
|
||||||
ALPHA_VANTAGE_KEY=
|
ALPHA_VANTAGE_KEY=
|
||||||
CUSTOM_SEARCH_ID=
|
CUSTOM_SEARCH_ID=
|
||||||
DEVIANTART_ID=
|
DEVIANTART_ID=
|
||||||
|
|||||||
@@ -3,12 +3,13 @@ const { MessageEmbed } = require('discord.js');
|
|||||||
const request = require('node-superfetch');
|
const request = require('node-superfetch');
|
||||||
const { stripIndents } = require('common-tags');
|
const { stripIndents } = require('common-tags');
|
||||||
const { verify } = require('../../util/Util');
|
const { verify } = require('../../util/Util');
|
||||||
|
const { AKINATOR_UID } = process.env;
|
||||||
|
|
||||||
module.exports = class AkinatorCommand extends Command {
|
module.exports = class AkinatorCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'akinator',
|
name: 'akinator',
|
||||||
aliases: ['the-web-genie', 'web-genie'],
|
aliases: ['the-web-genie', 'web-genie', 'aki'],
|
||||||
group: 'games',
|
group: 'games',
|
||||||
memberName: 'akinator',
|
memberName: 'akinator',
|
||||||
description: 'Think about a real or fictional character, I will try to guess who it is.',
|
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({
|
.query({
|
||||||
partner: 1,
|
partner: 1,
|
||||||
player: 'website-desktop',
|
player: 'website-desktop',
|
||||||
uid_ext_session: '5ba118d44e469',
|
uid_ext_session: AKINATOR_UID,
|
||||||
frontaddr: 'MTc4LjMzLjIzMS45OA==',
|
frontaddr: 'MTc4LjMzLjIzMS45OA==',
|
||||||
constraint: 'ETAT<>\'AV\'',
|
constraint: 'ETAT<>\'AV\'',
|
||||||
soft_constraint: channel.nsfw ? '' : 'ETAT=\'EN\'',
|
soft_constraint: channel.nsfw ? '' : 'ETAT=\'EN\'',
|
||||||
question_filter: channel.nsfw ? '' : 'cat=1',
|
question_filter: channel.nsfw ? '' : 'cat=1',
|
||||||
_: Date.now()
|
_: Date.now()
|
||||||
});
|
});
|
||||||
|
if (body.completion !== 'OK') return null;
|
||||||
const data = body.parameters;
|
const data = body.parameters;
|
||||||
if (!data) return null;
|
|
||||||
this.sessions.set(channel.id, {
|
this.sessions.set(channel.id, {
|
||||||
id: data.identification.session,
|
id: data.identification.session,
|
||||||
signature: data.identification.signature,
|
signature: data.identification.signature,
|
||||||
@@ -99,8 +100,8 @@ module.exports = class AkinatorCommand extends Command {
|
|||||||
question_filter: channel.nsfw ? '' : 'cat=1',
|
question_filter: channel.nsfw ? '' : 'cat=1',
|
||||||
_: Date.now()
|
_: Date.now()
|
||||||
});
|
});
|
||||||
|
if (body.completion !== 'OK') return null;
|
||||||
const data = body.parameters;
|
const data = body.parameters;
|
||||||
if (!data) return null;
|
|
||||||
this.sessions.set(channel.id, {
|
this.sessions.set(channel.id, {
|
||||||
id: session.id,
|
id: session.id,
|
||||||
signature: session.signature,
|
signature: session.signature,
|
||||||
@@ -126,7 +127,7 @@ module.exports = class AkinatorCommand extends Command {
|
|||||||
mode_question: 0,
|
mode_question: 0,
|
||||||
_: Date.now()
|
_: Date.now()
|
||||||
});
|
});
|
||||||
if (!body.parameters) return null;
|
if (body.completion !== 'OK') return null;
|
||||||
return body.parameters.elements[0].element;
|
return body.parameters.elements[0].element;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "95.1.5",
|
"version": "95.1.6",
|
||||||
"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