mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
Just use cleverio
This commit is contained in:
@@ -11,7 +11,7 @@ const path = require('path');
|
||||
const { carbon, dBots } = require('./structures/Stats');
|
||||
const SequelizeProvider = require('./providers/Sequelize');
|
||||
const Database = require('./structures/PostgreSQL');
|
||||
const Cleverbot = require('./structures/Cleverbot');
|
||||
const Cleverbot = require('cleverio');
|
||||
const clevs = new Cleverbot({
|
||||
key: CLEVS_KEY,
|
||||
user: CLEVS_USER,
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
"bufferutil": "^3.0.0",
|
||||
"canvas": "automattic/node-canvas",
|
||||
"cheerio": "^0.22.0",
|
||||
"cleverio": "dragonfire535/cleverio",
|
||||
"custom-translate": "dragonfire535/custom-translate",
|
||||
"discord.js": "hydrabolt/discord.js",
|
||||
"discord.js-commando": "gawdl3y/discord.js-commando",
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
const request = require('superagent');
|
||||
|
||||
class Cleverbot {
|
||||
constructor(options) {
|
||||
this.key = options.key;
|
||||
this.user = options.user;
|
||||
this.nick = options.nick;
|
||||
}
|
||||
|
||||
setNick(nick) {
|
||||
this.nick = nick;
|
||||
return this.nick;
|
||||
}
|
||||
|
||||
create() {
|
||||
return request
|
||||
.post('https://cleverbot.io/1.0/create')
|
||||
.send({
|
||||
user: this.user,
|
||||
key: this.key,
|
||||
nick: this.nick
|
||||
})
|
||||
.then(response => {
|
||||
return response.body;
|
||||
});
|
||||
}
|
||||
|
||||
ask(text) {
|
||||
return request
|
||||
.post('https://cleverbot.io/1.0/ask')
|
||||
.send({
|
||||
user: this.user,
|
||||
key: this.key,
|
||||
nick: this.nick,
|
||||
text
|
||||
})
|
||||
.then(response => {
|
||||
return response.body;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Cleverbot;
|
||||
Reference in New Issue
Block a user