0
我想提示問題與中是聊天窗口沒有選擇,如何使用PromptDialog.Confirm()在MessageController.cs POST方法
public class MessagesController : ApiController
{
public virtual async Task<HttpResponseMessage> Post([FromBody] Activity activity)
{
ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl));
Activity reply;
if (activity != null)
{
// check if activity is of type message
if (activity.Type == ActivityTypes.Message)
{
await GetEntityFromLUIS(activity);
}
else if (activity.Type == ActivityTypes.ConversationUpdate)
{
constructResponse = "Hi";
reply = activity.CreateReply($"{constructResponse}");
await connector.Conversations.ReplyToActivityAsync(reply); //After this we need Prompt question with Yes r No
}
}
else
{
connector = new ConnectorClient(new Uri(activity.ServiceUrl));
HandleSystemMessage(activity);
}
return new HttpResponseMessage(System.Net.HttpStatusCode.Accepted);
}
}
如何提示問題與**有任何疑問**和是否顯示後嗨。下一步,下面的代碼
reply = activity.CreateReply($"{constructResponse}");
await connector.Conversations.ReplyToActivityAsync(reply);
的答案在我需要聲明這證實功能後發生,在MessageController.cs中或需要創建任何其他類。我曾在同一個MessageController.cs中聲明,但bot沒有響應,儘管它沒有顯示「Hi」。 – Krishna