RogerO
RogerO

Reputation: 91

How to get PromptDialog.Choice features and still allow other User responses in Bot Framework?

The PromptDialog.Choice in the Bot Framework offers a lot of built in functionality that is working well. However, I would like to be able to intercept / override the matching process.

What's the best way to get the PromptDialog.Choice functionality and yet also be able to accept certain strings that may not be a match?

Example:

Bot: What else can I help you with?

Then allow user to enter a command or number that bypasses the options above, without triggering the retry error message.

Upvotes: 2

Views: 1482

Answers (1)

Ezequiel Jadib
Ezequiel Jadib

Reputation: 14787

I can think on two alternatives:

  1. Create your own PromptChoice dialog and override the TryParse logic to handle those strings that may not be a match. Here is an example of a 'CancelablePromptChoice' that basically recognize some cancelTerms that will allow the user to exit the PromptChoice without selecting any of the options.
  2. Use Facebook's quick replies but the drawback is that you will have to write some of the logic that is already in place in the PromptChoice. Here is an example of using Facebook's quick replies with the Microsoft Bot Framework that I wrote a few weeks ago.

Upvotes: 1

Related Questions