A Node.js Cleverbot API wrapper library. Go make a chat bot in a flash!
npm install cleverbot.jsIt supports both cleverbot.com and
cleverbot.io





Before installing, download and install Node.js.
I recommend installing the latest LTS version of Node.js.
Installation is done using the npm install command:
``bash`
$ npm install cleverbot.js --save
js
new Cleverbot.com(options);
`
| Parameter | Type | Optional | Default | Description |
| - | - | - | - | - |
| options | Object | ❌ | - | The options for initializing cleverbot.js |
| options.APIKey | String | ❌ | - | The API key that you got from the cleverbot website |
| options.preserveState | Boolean | ✔ | false | Whether to preserve the state of the conversations. |#### Example
`js
const Cleverbot = require('cleverbot.js');
let options = {
APIKey: 'CFDoi4234falFOFaSfwepxXhBRW',
preserveState: true
};
cleverbot = new Cleverbot.com(options);cleverbot.write('Hi how\'re you?').then(response => {
console.log(response.output); // Fine, how're you?
}).catch(e => {
console.error(e);
});
`$3
`js
new Cleverbot.io(options);
`
| Parameter | Type | Optional | Default | Description |
| - | - | - | - | - |
| options | Object | ❌ | - | The options for initializing cleverbot.js |
| options.APIUser | String | ❌ | - | The API user that you got from the cleverbot website |
| options.APIKey | String | ❌ | - | The API key that you got from the cleverbot website |#### Example
`js
const Cleverbot = require('cleverbot.js');
let options = {
APIUser: 'FaSfwepxX34falFO',
APIKey: 'CFDoi4234falFOFaSfwepxXhBRW'
};
cleverbot = new Cleverbot.io(options);cleverbot.init().then(nick => {
cleverbot.write('Hi how\'re you?', nick).then(response => {
console.log(response.output); // Good, and you?
}).catch(e => {
console.error(e);
});
}).catch(e => {
console.error(e);
})
``> If you liked this project you can ⭐ Star it on
> GitHub to show your love and/or
> send a thank you note.