Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ITriggerActionOptions

Options passed when defining a triggerAction().

Hierarchy

Index

Properties

Optional confirmPrompt

confirmPrompt: TextOrMessageType

If specified the user will be asked to confirm that they are ok canceling the current uncompleted task.

Optional dialogArgs

dialogArgs: any

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

Optional intentThreshold

intentThreshold: number

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

Optional matches

matches: MatchType

(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.

Optional onFindAction

onFindAction: function

(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.

Type declaration

Optional onInterrupted

onInterrupted: function

(Optional) custom handler called when a root dialog is being interrupted by another root dialog. This gives the dialog an opportunity to perform custom cleanup logic or to prompt the user to confirm the interruption was intended.

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.

Type declaration

    • (session: Session, dialogId: string, dialogArgs?: any, next?: Function): void
    • Parameters

      • session: Session
      • dialogId: string
      • Optional dialogArgs: any
      • Optional next: Function

      Returns void

Optional onSelectAction

onSelectAction: function

(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.

Type declaration

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