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
-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;