I am using Bot Framework .Net SDK v4 and direct line web chat client. I have my dialogs as waterfall steps. Is it possible to use a suggested action inside a waterfall step? I am aware that a choice prompt will serve the purpose but I want the buttons to disappear after user clicks any choice, hence want to use suggested actions.
What I have tried.
In the constructor :
AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));
In waterfall step:
public async Task<DialogTurnResult> FirstStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
{
var promptOptions = new PromptOptions()
{
Prompt = MessageFactory.Text("What card would you like to see? You can click or type the card name"),
RetryPrompt = MessageFactory.Text("That was not a valid choice, please select a card or number from 1 to 9."),
Choices = GetChoices(),
Style = ListStyle.SuggestedAction
};
return await stepContext.PromptAsync(nameof(ChoicePrompt), promptOptions);
}
private IList<Choice> GetChoices()
{
var cardOptions = new List<Choice>()
{
new Choice() { Value = "Card 1", Synonyms = new List<string>() { "adaptive" } },
new Choice() { Value = "Card 2", Synonyms = new List<string>() { "animation" } },
};
return cardOptions;
}