Code Monkey home page Code Monkey logo

banking-beagle's Introduction

Chatbot

Based off the Facebook sample code.

Run

You can start the server by running npm start. However, the webhook must be at a public URL that the Facebook servers can reach. Therefore, running the server locally on your machine will not allow you to test via Facebook messanger but you can send sample input to your localhost:5000/webhook endpoint. A sample body is below

{
  "object": "page",
  "entry": [
      {
          "id": "1",
          "time": 1471760180753,
          "messaging": [
              {
                  "sender": {
                      "id": "1"
                  },
                  "recipient": {
                      "id": "2"
                  },
                  "timestamp": 1471760180696,
                  "message": {
                      "mid": "mid.1471760180689:53818e6ab8064b1077",
                      "seq": 626,
                      "text": "hey"
                  }
              }
          ]
      }
  ]
}

Add New Features

Implement a new feature in /features which exports a trigger(actionName) function and a action(recipientId, apiAiResponse) function. The first should return true if the message received should trigger the feature and the second should act on the message. See the echo.js feature for a simple example which acts as the final catch-all if no other feature is triggered.

Add your new feature to the list of enabled features in config/features.js and that's it.

Changes to the master branch will be deployed to Heroku through Codeship, and the build status will be shown next to the commit here on BitBucket

banking-beagle's People

Contributors

minh-dang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.