Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Dialogue

Add, remove and return branch sets, for managing conversation flow.

Hierarchy

  • Dialogue

Implements

Index

Constructors

constructor

  • Create and configure dialogue from options/defaults, link with state. Default onTimeout method sends text, but the method can be overridden. Create and configure dialogue from options/defaults, link with state. Default onTimeout method sends text, but the method can be overridden.

    Parameters

    Returns Dialogue

Properties

audience

audience: "direct" | "user" | "room"

branchHistory

branchHistory: BranchController[] = []

branches

  • get branches(): BranchController

Optional clock

clock: NodeJS.Timer

defaultBranches

defaultBranches: IBranches

id

id: string

Optional onClose

onClose: ICallback

Optional onOpen

onOpen: ICallback

Optional onTimeout

onTimeout: ICallback

Optional state

state: State

timeout

timeout: number

timeoutMethod

timeoutMethod: string

timeoutText

timeoutText: string

Methods

close

  • close(): Promise<boolean>
  • Close dialogue (if open), call callback and disengage audience.

    Returns Promise<boolean>

open

  • open(state: State): Promise<boolean>
  • Open dialogue and call optional callback (e.g. send opening message)

    Parameters

    Returns Promise<boolean>

progressBranches

  • Return current branches, adding a new set to the top of the stack.

    Returns BranchController | undefined

revertBranches

  • Remove current branches from stack, returning the previous.

    Returns BranchController

startClock

  • startClock(ms?: undefined | number): Timer | undefined
  • Start (or restart) countdown for matching dialogue branches.

    Parameters

    • Optional ms: undefined | number

    Returns Timer | undefined

stopClock

  • stopClock(): void
  • Stop countdown for matching dialogue branches.

    Returns void

Generated using TypeDoc