0
嗨,大家好我使用formflow,一切都很顺利,我只是有一些小细节需要修复。在Formflow上检查用户输入
- 有没有办法让我通过正则表达式检查用户在Formflow中的输入?我需要检查用户是否输入了有效的姓名,电子邮件等。
- 我可以在配置文件完成之前将确认更改为yes或no按钮,而不是键入yes或no或y或n吗?
下面是所以这个尚未在一个月内答复,所以我现在希望你已经发现自己的答案代码
[Serializable]
public class ProfileForm
{
[Prompt("What is your first name? {||}")]
public string FirstName;
[Prompt("What is your last name? {||}")]
public string LastName;
[Prompt("What is your email? {||}")]
public string Email;
public static IForm<ProfileForm> BuildForm()
{
return new FormBuilder<ProfileForm>()
.Message("Welcome to the profile bot!")
.OnCompletion(async (context, profileForm) =>
{
// Tell the user that the form is complete
await context.PostAsync("Your profile is complete.");
})
.Build();
}
}
修改了我的答案,回答你的问题的第二部分,希望它有帮助。 – Witted