2
是否有可能使用Bot Framework在FormDialog中更改Quit commando的关键字?在FormFlows中添加另一个关键字Quit - Bot Framework
我想抛出FormCanceledException当某个单词键入(不使用英语作为语言)。
如果我可以改变的关键字,或添加另一种不一样的退出也将是完美的
是否有可能使用Bot Framework在FormDialog中更改Quit commando的关键字?在FormFlows中添加另一个关键字Quit - Bot Framework
我想抛出FormCanceledException当某个单词键入(不使用英语作为语言)。
如果我可以改变的关键字,或添加另一种不一样的退出也将是完美的
是的,这是可能的。一种方法是为FormCommand.Quit
命令添加一个新术语。
Here你会发现
private static IFormBuilder<T> CreateCustomForm<T>()
where T : class
{
var form = new FormBuilder<T>();
var command = form.Configuration.Commands[FormCommand.Quit];
var terms = command.Terms.ToList();
terms.Add("cancel");
command.Terms = terms.ToArray();
var templateAttribute = form.Configuration.Template(TemplateUsage.NotUnderstood);
var patterns = templateAttribute.Patterns;
patterns[0] += " Type *cancel* to quit or *help* if you want more information.";
templateAttribute.Patterns = patterns;
return form;
}
它的工作是(以下和代码,供大家参考)做的正是这样的例子!很多! –