cleverapi
v1.0.0
Published
A quick and simple promise based cleverbot.io package
Downloads
2
Readme
- CleverApi-
Installation
Install from NPM:
npm install cleverapi
Initialise:
const cleverapi = require('cleverapi');
const bot = new cleverapi('<user>', '<key>', '<optional_token>');
Ask a question:
bot.ask('test', '<otpional_token>').then(response => {
console.log(response); // Will probably respond "Yes this is a test."
}).catch(console.log);
Remembering a session:
Tokens are used to remember sessions, you can either pass this when initialising if you plan to only use one instance or pass it as a second argument when asking a question for multiple sessions.
bot.token; // Gets the token set manually or automatically