Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

[PORT] Hardened prompts #562

Closed
tomlm opened this issue May 21, 2020 · 0 comments
Closed

[PORT] Hardened prompts #562

tomlm opened this issue May 21, 2020 · 0 comments

Comments

@tomlm
Copy link
Contributor

tomlm commented May 21, 2020

Port this change from botbuilder-dotnet/master branch:
microsoft/botbuilder-dotnet#3949

See parent PR: microsoft/botbuilder-js#2246

Description

Some of the prompts break if user uploads an attachment instead of responding with text because of some of the string methods that get called on activity.text (which doesn't exist if an attachment is sent).

Specific Changes

Add some variation of

if (string.isNullOrEmpty(turnContext.Activity.Text)) {
  return Task.FromResult(result);
}

to:

  1. ChoicePrompt
  2. DatetimePrompt
  3. NumberPrompt
  4. ConfirmPrompt

I also renamed message to utterance to be more in line with other prompts.

The original issue was only for DatetimePrompt, but I added the other two. Other prompts didn't seem relevant for this.

Changed projects

  • Microsoft.Bot.Builder.Dialogs
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants