大家好,我正在使用 formflow,一切都很顺利,我只是有一些小细节需要修复。
- 有没有办法让我通过正则表达式在表单流中检查用户输入?我需要检查用户是否输入了有效的姓名、电子邮件等。
- 我可以在配置文件完成之前将确认更改为是或否按钮,而不是键入是或否或 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();
}
}