IBeginDialogActionOptions interface

Options passed when defining a beginDialogAction().

Extends

Properties

dialogArgs

(Optional) arguments to pass to the dialog spawned when the action is triggered.

intentThreshold

(Optional) minimum score needed to trigger the action using the value of matches. The default value is 0.1.

matches

(Optional) intent(s) used to trigger the action. Either a regular expression or a named intent can be provided and multiple intents can be specified. When a named intent is provided the action will be matched using the recognizers assigned to the library/bot using Library.recognizer(). If a matches option isn't provided then the action can only be matched if an onFindAction handler is provided.

onFindAction

(Optional) custom handler that's invoked whenever the action is being checked to see if it should be triggered. The handler is passed a context object containing the received message and any intents detected. The handler should return a confidence score for 0.0 to 1.0 and routeData that should be passed in during the selectActionRoute call.

onSelectAction

(Optional) custom handler that's invoked whenever the action is triggered. This lets you customize the behavior of an action. For instance you could clear the dialog stack before the new dialog is started, changing the default behavior which is to just push the new dialog onto the end of the stack. It's important to note that this is not a waterfall and you should call next() if you would like the actions default behavior to run.

Property Details

dialogArgs

(Optional) arguments to pass to the dialog spawned when the action is triggered.

dialogArgs?: any

Property Value

any

intentThreshold

(Optional) minimum score needed to trigger the action using the value of matches. The default value is 0.1.

intentThreshold?: number

Property Value

number

matches

(Optional) intent(s) used to trigger the action. Either a regular expression or a named intent can be provided and multiple intents can be specified. When a named intent is provided the action will be matched using the recognizers assigned to the library/bot using Library.recognizer(). If a matches option isn't provided then the action can only be matched if an onFindAction handler is provided.

matches?: MatchType

Property Value

onFindAction

(Optional) custom handler that's invoked whenever the action is being checked to see if it should be triggered. The handler is passed a context object containing the received message and any intents detected. The handler should return a confidence score for 0.0 to 1.0 and routeData that should be passed in during the selectActionRoute call.

onFindAction?: (context: IFindActionRouteContext, callback: (err: Error, score: number, routeData?: IActionRouteData) => void) => void

Property Value

(context: IFindActionRouteContext, callback: (err: Error, score: number, routeData?: IActionRouteData) => void) => void

onSelectAction

(Optional) custom handler that's invoked whenever the action is triggered. This lets you customize the behavior of an action. For instance you could clear the dialog stack before the new dialog is started, changing the default behavior which is to just push the new dialog onto the end of the stack. It's important to note that this is not a waterfall and you should call next() if you would like the actions default behavior to run.

onSelectAction?: (session: Session, args?: IActionRouteData, next?: Function) => void

Property Value

(session: Session, args?: IActionRouteData, next?: Function) => void