Prompts class
Built in built-in prompts that can be called from any dialog.
- Extends
Methods
Method Details
action(CallSession, IAction | IIsAction)
Sends a wrokflow action as a prompt to the user. Lets you process the raw outcome
static function action(session: CallSession, action: IAction | IIsAction)
Parameters
- session
- CallSession
Session object for the current conversation.
begin<T>(CallSession, T)
Called when a new dialog session is being started.
function begin<T>(session: CallSession, args?: T)
Parameters
- session
- CallSession
Session object for the current conversation.
- args
-
T
(Optional) arguments passed to the dialog by its parent.
choice(CallSession, string | string[] | IAction | IIsAction, IRecognitionChoice[], IRecognizerPromptOptions)
Prompts the user to choose from a list of options.
static function choice(session: CallSession, playPrompt: string | string[] | IAction | IIsAction, choices: IRecognitionChoice[], options?: IRecognizerPromptOptions)
Parameters
- session
- CallSession
Session object for the current conversation.
- playPrompt: {string} - Initial message to send the user.
- playPrompt: {string[]} - Array of possible messages to send user. One will be chosen at random.
- playPrompt: {IAction|IIsAction} - Initial PlayPrompt action to send the user.
- choices
List of choices to prompt user with.
- options
- IRecognizerPromptOptions
(Optional) parameters to control the behaviour of the prompt.
configure(IPromptsSettings)
Updates global options for the Prompts dialog.
static function configure(settings: IPromptsSettings)
Parameters
- settings
- IPromptsSettings
Options to set.
confirm(CallSession, string | string[] | IAction | IIsAction, IConfirmPromptOptions)
Prompts the user to confirm an action with a yes/no response.
static function confirm(session: CallSession, playPrompt: string | string[] | IAction | IIsAction, options?: IConfirmPromptOptions)
Parameters
- session
- CallSession
Session object for the current conversation.
- playPrompt: {string} - Initial message to send the user.
- playPrompt: {string[]} - Array of possible messages to send user. One will be chosen at random.
- playPrompt: {IAction|IIsAction} - Initial PlayPrompt action to send the user.
- options
- IConfirmPromptOptions
(Optional) parameters to control the behaviour of the prompt.
dialogResumed<T>(CallSession, IDialogResult<T>)
A child dialog has ended and the current one is being resumed.
function dialogResumed<T>(session: CallSession, result: IDialogResult<T>)
Parameters
- session
- CallSession
Session object for the current conversation.
- result
Result returned by the child dialog.
digits(CallSession, string | string[] | IAction | IIsAction, number, IDigitsPromptOptions)
Prompts the user to input a sequence of digits.
static function digits(session: CallSession, playPrompt: string | string[] | IAction | IIsAction, maxDigits: number, options?: IDigitsPromptOptions)
Parameters
- session
- CallSession
Session object for the current conversation.
- playPrompt: {string} - Initial message to send the user.
- playPrompt: {string[]} - Array of possible messages to send user. One will be chosen at random.
- playPrompt: {IAction|IIsAction} - Initial PlayPrompt action to send the user.
- maxDigits
-
number
Maximum number of digits allowed.
- options
- IDigitsPromptOptions
(Optional) parameters to control the behaviour of the prompt.
record(CallSession, string | string[] | IAction | IIsAction, IRecordPromptOptions)
Prompts the user to record a message.
static function record(session: CallSession, playPrompt: string | string[] | IAction | IIsAction, options?: IRecordPromptOptions)
Parameters
- session
- CallSession
Session object for the current conversation.
- playPrompt: {string} - Initial message to send the user.
- playPrompt: {string[]} - Array of possible messages to send user. One will be chosen at random.
- playPrompt: {IAction|IIsAction} - Initial PlayPrompt action to send the user.
- options
- IRecordPromptOptions
(Optional) parameters to control the behaviour of the prompt.
replyReceived(CallSession)
Processes messages received from the user. Called by the dialog system.
function replyReceived(session: CallSession)
Parameters
- session
- CallSession
Session object for the current conversation.