Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SimpleDialog

Allows for the creation of custom dialogs that are based on a simple closure. This is useful for cases where you want a dynamic conversation flow or you have a situation that just doesn’t map very well to using a waterfall. The things to keep in mind:

  • Your dialogs closure is can get called in two different contexts that you potentially need to test for. It will get called as expected when the user send your dialog a message but if you call another prompt or dialog from your closure it will get called a second time with the results from the prompt/dialog. You can typically test for this second case by checking for the existant of an args.resumed property. It's important to avoid getting yourself into an infinite loop which can be easy to do.
  • Unlike a waterfall your dialog will not automatically end. It will remain the active dialog until you call session.endDialog().

Hierarchy

Index

Constructors

constructor

  • Creates a new custom dialog based on a simple closure.

    Parameters

    • handler: function

      The function closure for your dialog.

        • Parameters

          • session: CallSession

            Session object for the current conversation.

          • Optional args: any | IDialogResult<any>
            • args: {any} - For the first call to the handler this will be either null or the value of any arguments passed to Session.beginDialog().
            • args: {IDialogResult} - If the handler takes an action that results in a new dialog being started those results will be returned via subsequent calls to the handler.

          Returns void

    Returns SimpleDialog

Methods

begin

  • Called when a new dialog session is being started.

    Type parameters

    • T

    Parameters

    • session: CallSession

      Session object for the current conversation.

    • Optional args: T

      (Optional) arguments passed to the dialog by its parent.

    Returns void

dialogResumed

replyReceived

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method