Just use cleverio

This commit is contained in:
Daniel Odendahl Jr
2017-05-14 16:10:41 +00:00
parent be7d6f449c
commit b6d3188aae
3 changed files with 2 additions and 44 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ const path = require('path');
const { carbon, dBots } = require('./structures/Stats'); const { carbon, dBots } = require('./structures/Stats');
const SequelizeProvider = require('./providers/Sequelize'); const SequelizeProvider = require('./providers/Sequelize');
const Database = require('./structures/PostgreSQL'); const Database = require('./structures/PostgreSQL');
const Cleverbot = require('./structures/Cleverbot'); const Cleverbot = require('cleverio');
const clevs = new Cleverbot({ const clevs = new Cleverbot({
key: CLEVS_KEY, key: CLEVS_KEY,
user: CLEVS_USER, user: CLEVS_USER,
+1
View File
@@ -36,6 +36,7 @@
"bufferutil": "^3.0.0", "bufferutil": "^3.0.0",
"canvas": "automattic/node-canvas", "canvas": "automattic/node-canvas",
"cheerio": "^0.22.0", "cheerio": "^0.22.0",
"cleverio": "dragonfire535/cleverio",
"custom-translate": "dragonfire535/custom-translate", "custom-translate": "dragonfire535/custom-translate",
"discord.js": "hydrabolt/discord.js", "discord.js": "hydrabolt/discord.js",
"discord.js-commando": "gawdl3y/discord.js-commando", "discord.js-commando": "gawdl3y/discord.js-commando",
-43
View File
@@ -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;