diacus / wfc

Language to simplify chatbot script development

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wizeline Flow

Language to simplify chatbot script development

Contents

  1. Install
  2. Usage
  3. Language Reference
  4. Hello World

Install

Install WFC

Note: you can install this package inside a virtual environment too ;)

  1. Go to WFC releases and download the most recent release

  2. Install the package with pip3, since this tool is writen using Python3

$ pip3 install /path/to/wfc-X.Y.zip

Usage

Command Line

With the snipet shown at Hello World section do:

$ python -m wfc < hello.flow > hello.yaml

Or:

$ wfc < hello.flow > hello.json

And you'll get a new file hello.json with this contents:

{
  "version": "2.1.0",
  "flows": [
    {
      "name": "helloWorld",
      "actions": [
        {
          "send_text": {
            "text": "Hello World, I am a Bot!"
          },
          "id": "15f644f7-69da-4278-91ab-f7284c9b93a7"
        }
      ]
    }
  ]
}

Or:

$ wfc -v 2.2.0 < hello.flow > hello.json

And you'll get a new file hello.json with this contents:

{
  "version": "2.2.0",
  "flows": [
    {
      "name": "helloWorld",
      "actions": [
        {
          "send_text": {
            "text": "Hello World, I am a Bot!"
          },
          "id": "324e027c-7beb-42eb-b2ab-6f27c0ff757a"
        }
      ]
    }
  ]
}

There are some command line options available

  • -o or --output specifies an output path to use rather than the standard output
  • -q or --quiet runs the compiler in quiet mode, so it won't display any error message
  • -v or --outversion specifies the output version format, currently it supports script versions 2.1.0 and 2.2.0. see output versions for details.
  • -w or --workdir sets the working directory, its the fault value is the current work directory
  • -h or --help displays help information
  • -V or --version displays the version number

Examples:

$ wfc -o my-bot.json module1.flow module2.flow main.flow
$ wfc -v 2.2.0 -o my-bot.json module1.flow module2.flow main.flow

Hello World

flow helloWorld do
  say 'Hello World, I am a Bot!'
done

For more details about Wizeline Flow, see the language reference

About

Language to simplify chatbot script development


Languages

Language:Python 100.0%Language:Makefile 0.0%