Edit

Share via


DialogAction class

Dialog actions offer shortcuts to implementing common actions.

Methods

beginDialog<T>(string, T)

Returns a closure that will passes control of the conversation to a new dialog.

endDialog(any)

Returns a closure that will end the current dialog.

send(string, any[])

Returns a closure that will send a simple text message to the user.

Method Details

beginDialog<T>(string, T)

Returns a closure that will passes control of the conversation to a new dialog.

static function beginDialog<T>(id: string, args?: T)

Parameters

id

string

Unique ID of the dialog to start.

args

T

(Optional) arguments to pass to the dialogs begin() method.

Returns

endDialog(any)

Returns a closure that will end the current dialog.

static function endDialog(result?: any)

Parameters

result

any

(Optional) results to pass to the parent dialog.

Returns

send(string, any[])

Returns a closure that will send a simple text message to the user.

static function send(msg: string, args: any[])

Parameters

msg

string

Text of the message to send. The message will be localized using the sessions configured localizer. If arguments are passed in the message will be formatted using sprintf-js (see the docs for details.)

args

any[]

(Optional) arguments used to format the final output string.

Returns