diff --git a/index.js b/index.js index 0a6b6b37..58cd1765 100644 --- a/index.js +++ b/index.js @@ -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, diff --git a/package.json b/package.json index 65f5bb8e..4f299d22 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/structures/Cleverbot.js b/structures/Cleverbot.js deleted file mode 100644 index 0707dd11..00000000 --- a/structures/Cleverbot.js +++ /dev/null @@ -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;