How to use the node-wit.log function in node-wit

To help you get started, we’ve selected a few node-wit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github youssef06 / show-around / index.js View on Github external
const bodyParser = require('body-parser')
const express = require('express')
const Wit = require('node-wit').Wit
const log = require('node-wit').log
const Bot = require('./bot')
const getimage = require('./image-search.js')
const config = require('./config')

let bot = new Bot(config);

// Our bot actions
const actions = {
    /**
     * This is used by the "Bot sends" action in Wit
     * @param sessionId
     * @param text
     * @param quickreplies
     * @returns {Promise.}
     */
    send({sessionId}, {text, quickreplies}) {
github wit-ai / node-wit / examples / messenger.js View on Github external
// 6. Talk to your bot on Messenger!

const bodyParser = require('body-parser');
const crypto = require('crypto');
const express = require('express');
const fetch = require('node-fetch');

let Wit = null;
let log = null;
try {
  // if running from repo
  Wit = require('../').Wit;
  log = require('../').log;
} catch (e) {
  Wit = require('node-wit').Wit;
  log = require('node-wit').log;
}

// Webserver parameter
const PORT = process.env.PORT || 8445;

// Wit.ai parameters
const WIT_TOKEN = process.env.WIT_TOKEN;

// Messenger API parameters
const FB_PAGE_TOKEN = process.env.FB_PAGE_TOKEN;
if (!FB_PAGE_TOKEN) { throw new Error('missing FB_PAGE_TOKEN') }
const FB_APP_SECRET = process.env.FB_APP_SECRET;
if (!FB_APP_SECRET) { throw new Error('missing FB_APP_SECRET') }

let FB_VERIFY_TOKEN = null;
crypto.randomBytes(8, (err, buff) => {

node-wit

Wit.ai Node.js SDK

Unrecognized
Latest version published 2 years ago

Package Health Score

54 / 100
Full package analysis