问题
I'm looking for how we can show choices to user with IDialog<object>
and PromtDialog.Choice
method. But the thing is below code sample doesn't show the choices. Very difficult to find code sample. Looking for a help. Thank you.
List<string> BotOptions = new List<string>();
BotOptions.Add("Find a Program");
BotOptions.Add("Find an Event");
PromptDialog.Choice(context,
ChoiceSelectAsync,BotOptions,
"I didn't understand you. I'm cable to help you with",
"Didn't get that",
1,
PromptStyle.None);
回答1:
You need to change the PromptStyle to anything but None.
The available options are:
Auto
Generate buttons for choices and let connector generate the right style based on channel capabilitiesAutoText
Show choices as Text. The prompt decides if it should generate the text inline or perline based on number of choices.Inline
Show choices on the same line.PerLine
Show choices with one per line.None
Do not show possible choices in the prompt
source
回答2:
I think to get the prompt of choices you must "call" the promptDialog, use 'PromptChoice' option instead of 'choice'
var choosenResult = new PromptDialog.PromptChoice<string>
(new string[] { "Find a Program", "Find an Event" },
"Which one would you like?",
"Didn't get that", 3);
context.Call(choosenResult, AfterUserHasChosenAsync);
来源:https://stackoverflow.com/questions/38072037/promptdialog-choice-does-not-show-choices