Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Bot building superpowers.
## Documentation

* [How it Works](docs/index.md)
* [FlowScript](docs/flowscript.md)
* [The DeepDialog Scripting Language](docs/scripting.md)

## Example

Expand Down Expand Up @@ -81,7 +81,7 @@ Step by step instructions - or checkout the starter bot:

#### 1. Write Dialogs

Checkout the [FlowScript](docs/flowscript.md) for a high-level approach
Checkout [DeepDialog Script](docs/scripting.md) for a high-level approach
to writing dynamic conversations.

```javascript
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

DeepDialog helps you write more sophisticated chatbots. Currently, you can connect to Facebook, Twitter, WhatsApp, Kik and many other services through Smooch.io.

## FlowScript
## DeepDialog Script

[FlowScript](./flowscript.md) is a high level language that makes it easy to script conversational flows. The rest of this document explains how the DeepDialog service works and describes the core service objects.
[DDS](./scripting.md) is a high level language that makes it easy to script conversational flows. The rest of this document explains how the DeepDialog service works and describes the core service objects.

### Dialogs: Functions for Conversational Logic

Expand Down
10 changes: 5 additions & 5 deletions docs/flowscript.md → docs/scripting.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# FlowScript
# DeepDialog Scripting Language

## Overview

FlowScript is a Node.js DSL that lets a chatbot developer write dynamic conversational flows. A flow is a sequence of commands for the bot to execute, such as sending messages with images and/or buttons, branching logic, loops and calling reusable conversational procedures, called dialogs.
The DeepDialog Script (DDS) is a Node.js DSL that lets a chatbot developer write dynamic conversational flows. A flow is a sequence of commands for the bot to execute, such as sending messages with images and/or buttons, branching logic, loops and calling reusable conversational procedures, called dialogs.

A single flow might encompass several interactions with a user, mediated by several HTTP requests on the bot server occurring over minutes, hours or days. In FlowScript you script these interactions in the order they happen in a conversation. The FlowScript compiler generates methods in the bot web server that handle each interaction that makes up a conversation.
A single flow might encompass several interactions with a user, mediated by several HTTP requests on the bot server occurring over minutes, hours or days. In DDS you write these interactions in the order they happen in a conversation. The script compiler generates methods in the bot web server that handle each interaction that makes up a conversation.

This frees you from worrying about low-level details and keeps your conversational logic in a readable form, instead of scattered over several separate controller methods. The web server itself is [stateless](https://en.wikipedia.org/wiki/Service_statelessness_principle ) - all conversation state is stored in the DeepDialog backend. This means you can write your bot using familiar control flow structures, yet scale it like a traditional web service.

Dialogs and Sessions are the main building blocks of FlowScript. Dialogs are analogous to functions: they contain program logic which is run on your bot server. Like functions, they take parameters when started and return a value on completion. The DeepDialog backend provides the storage for managing the dialog call stack, including local and global variables. These capabilities are abstracted by the Session. Each session tracks the state of a conversation with an endpoint. This is usually a user, but could be a chatroom.
Dialogs and Sessions are the main building blocks of DDS. Dialogs are analogous to functions: they contain program logic which is run on your bot server. Like functions, they take parameters when started and return a value on completion. The DeepDialog backend provides the storage for managing the dialog call stack, including local and global variables. These capabilities are abstracted by the Session. Each session tracks the state of a conversation with an endpoint. This is usually a user, but could be a chatroom.

In practical terms, a flow is a Javascript Array, and commands are Javascript Objects or functions. This means a developer can generate flows programmatically. Parts of the conversation can be generated dynamically by replacing part of the conversation tree with a function. For example, you can dynamically generate action buttons by providing a function to the `actions` parameter of a message command. If you need to, you can also access the DeepDialog API directly using a function placed inside a flow. See the documentation [here](./index.md).

Expand Down Expand Up @@ -295,7 +295,7 @@ Note that strings returned by handlers will not be interpolated. Within a handl

## Command Types

The most basic kind of command is sending a message to the user. FlowScript provides commands for each of the message types supported by the DeepDialog API's messageSend endpoint.
The most basic kind of command is sending a message to the user. DScript provides commands for each of the message types supported by the DeepDialog API's messageSend endpoint.

### text Command

Expand Down
2 changes: 1 addition & 1 deletion src/flowdialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ import log, {stringify} from './log';


/**
* FlowDialog - Allows users to script flows. See the [documentation on github](https://github.com/aneilbaboo/deepdialog-node-client/blob/aneil/flowDialog/docs/flowscript.md)
* FlowDialog - Allows users to script flows. See the [documentation on github](https://github.com/aneilbaboo/deepdialog-node-client/blob/aneil/flowDialog/docs/scripting.md)
* @extends Dialog
*/
export default class FlowDialog extends Dialog {
Expand Down
2 changes: 1 addition & 1 deletion tests/flowdialog.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import FlowDialog, {
} from '../src/flowdialog';
import {$} from '../src/dollar-operator';

describe('FlowScript', function () {
describe('DeepDialog Script', function () {
var sandbox;

beforeEach(function () {
Expand Down