ChoicePrompt class

Prompts a user to select from a list of choices.

Extends
FoundChoice>

Remarks

By default the prompt will return to the calling dialog a FoundChoice object containing the choice that was selected.

Constructors

ChoicePrompt(string, PromptValidator<FoundChoice>, string)

Creates a new ChoicePrompt instance.

Properties

choiceOptions

Additional options passed to the ChoiceFactory and used to tweak the style of choices rendered to the user.

defaultLocale

The prompts default locale that should be recognized.

recognizerOptions

Additional options passed to the underlying recognizeChoices() function.

style

Style of the "yes" and "no" choices rendered to the user when prompting.

Constructor Details

ChoicePrompt(string, PromptValidator<FoundChoice>, string)

Creates a new ChoicePrompt instance.

new ChoicePrompt(dialogId: string, validator?: PromptValidator<FoundChoice>, defaultLocale?: string)

Parameters

dialogId
string

Unique ID of the dialog within its parent DialogSet.

validator
PromptValidator<FoundChoice>

(Optional) validator that will be called each time the user responds to the prompt. If the validator replies with a message no additional retry prompt will be sent.

defaultLocale
string

(Optional) locale to use if dc.context.activity.locale not specified. Defaults to a value of en-us.

Property Details

choiceOptions

Additional options passed to the ChoiceFactory and used to tweak the style of choices rendered to the user.

choiceOptions: ChoiceFactoryOptions | undefined

Property Value

ChoiceFactoryOptions | undefined

defaultLocale

The prompts default locale that should be recognized.

defaultLocale: string | undefined

Property Value

string | undefined

recognizerOptions

Additional options passed to the underlying recognizeChoices() function.

recognizerOptions: FindChoicesOptions | undefined

Property Value

FindChoicesOptions | undefined

style

Style of the "yes" and "no" choices rendered to the user when prompting.

style: ListStyle

Property Value

Remarks

Defaults to ListStyle.auto.