我有一個基本的形式。根據用戶的選擇,它會將其引導至各種形式的流。但我無法做到這一點。它在Microsoft BOT框架中一次又一次地重複第一個formFlow?如何在Microsoft bot框架中的多個表單之間切換?
//These are two forms that i have initiated. If a count is 1 then it must open first formflow otherwise the second formflow.
internal static IDialog<General> MakeRootDialog()
{
return Chain.From(() => FormDialog.FromForm(General.BuildForm));
}
internal static IDialog<ProfileForm> MakeRootDialog1()
{
return Chain.From(() => FormDialog.FromForm(ProfileForm.BuildForm));
}
public async Task<HttpResponseMessage> Post([FromBody]Activity activity)
{
if (activity.Type == ActivityTypes.Message && General.count == 0)
{
await Conversation.SendAsync(activity, MakeRootDialog);
General.count = 1;
}
else if(activity.Type == ActivityTypes.Message && General.count >= 1)
{
await Conversation.SendAsync(activity, MakeRootDialog1);
}
else
{
HandleSystemMessage(activity);
}
var response = Request.CreateResponse(HttpStatusCode.OK);
return response;
}
你能否包含一些代碼來理解你在做什麼以及爲什麼它不工作?很難爲您提供當前細節的答案。你有一個PromptChoice,並根據用戶選擇,你想啓動一個FormFlow嗎?你想從哪裏切換表單? –
我已添加上面的代碼。 –
@EzequielJadib請看上面的代碼,我剛剛添加了 –