Documentation

Do you use documentation to use NewBot Framework

Chatbot to buy a movie

Use case

We hope that:

  1. The user can search for a movie
  2. A carousel of movies to discover is displayed
  3. The user can click on the "Buy" button to rent a movie.
  4. it opens a webview with an integrated Stripe.
  5. The user buys the film

First of all

  1. Create a Stripe account . Recover the public and private key
  2. Create a The Movie DB account . Retrieve the private key (Settings> API)
  3. Create a NewBot Cloud account . Recover only the public key (parameters> API)

Create a project

Do:

newbot new moviebot
cd moviebot

Install axios and stripe to later make queries and payment on Stripe

npm install axios stripe

Then generate a skill with:

newbot generate skill movie

The file main.js must just integrate the new skill:

import code from './main.converse'
import movie from './skills/movie/movie'

export default {
    code,
    skills: {
        movie
    }
}

Test locally

To test locally, you will need to run these commands:

export MOVIE_DB_KEY=<Your The Movie Db Private Key>
export STRIPE_KEY=<Your Stripe Private Key>
newbot serve
© 2019 NewBot