Code Monkey home page Code Monkey logo

landbot's Introduction

Landbot v0.0.1

Installation

npm i && npm run dev

Stages format

src/stages.js keeps list of named stages, that describes bot conversation logic.

Each key name of stage object used to link stages with actions.

{
    initial: [
        {
            text: 'Hi there!'
        },
        {
            delay: 200,
            typing: 500,
            text: 'Do you want to join party ?',
            actions: [
                {
                    text: 'Yes, shure',
                    link: 'join',
                    type: 'action'
                },
                {
                    text: 'No, thanks',
                    link: 'end'
                }
            ]
        }
    ],
    join: [
        {
            text: 'Welcome!'
        },
        {
            text: 'See ya!'
            redirect: 'end'
        }
    ],
    end: [
        {
            text: 'Ok, bye ;)'
        }
    ]
}

Stage

Every stage is an array, that contains one or several steps, that describes bot messages.

  • text – message
  • [component] – function, that return component(DOM element), that will placed in chat in circle(click to open).

NOTE: be sure you get imported components to bundle to use it.

  • [delay] (in ms) – time before step will be activated
  • [typing] (in ms) – time to show tying animation
  • [actions] – array of actions, that available for user after message appeared

Actions

  • text – action button text
  • [type] – button type. For exmaple value 'action' paint action button in green color
  • [link] – stage name, that activated when action is used
  • [redirect] – stage name, that activated immedialty after current stage

landbot's People

Contributors

apostololeg avatar

Stargazers

Vijayant Katyal avatar

Watchers

James Cloos avatar  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.