1.0.0 • Published 6 years ago

cleverapi v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

- 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