How do I cancel/exit or escape from PromptDialog.Choice in Bot Framework?

后端 未结 3 771
眼角桃花
眼角桃花 2020-12-21 14:33

The PromptDialog.Choice in the Bot Framework display the choice list which is working well. However, I would like to have an option to cancel/escape/exit the dialog with gi

3条回答
  •  鱼传尺愫
    2020-12-21 14:43

    There are two ways of achieving this:

    1. Add cancel as an option as suggested. While this would definitely work, long term you will find repeating yourself a lot, plus that you will see the cancel option in the list of choices, what may not be desired.
    2. A better approach would be to extend the current PromptChoice to add your exit/cancelation logic. The good news is that there is something already implemented that you could use as is or as the base to achieve your needs. Take a look to the CancelablePromptChoice included in the BotBuilder-Samples repository. Here is how to use it.

提交回复
热议问题