Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- free 100$ amazon gift card
- Messenger integration example
- See examples/messenger.js for a thoroughly documented tutorial.
- Overview
- The Wit module provides a Wit class with the following methods:
- message - the Wit message API
- You can also require a library function to test out your bot in the terminal. require('node-wit').interactive
- Wit class
- The Wit constructor takes the following parameters:
- accessToken - the access token of your Wit instance
- logger - (optional) the object handling the logging.
- apiVersion - (optional) the API version to use instead of the recommended one
- The logger object should implement the methods debug, info, warn and error. They can receive an arbitrary number of parameters to log. For convenience, we provide a Logger class, taking a log level parameter
- Example:
- const {Wit, log} = require('node-wit');
- const client = new Wit({
- accessToken: MY_TOKEN,
- logger: new log.Logger(log.DEBUG) // optional
- });
- console.log(client.message('set an alarm tomorrow at 7am'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement