2
嘗試使用以下代碼創建1:1會話時,出現錯誤消息「activityid不能爲空」,有人可以幫我指出什麼是錯的?BotFramework 1:1會話拋出錯誤「activityid不能爲空」
var newRecipient = new ChannelAccount();
newRecipient.Name = user.Mentioned.Name;
newRecipient.Id = user.Mentioned.Id;
var ConversationId = await connector.Conversations.CreateDirectConversationAsync(activity.Recipient, newRecipient);
IMessageActivity message = Activity.CreateMessageActivity();
message.From = activity.Recipient;
message.Recipient = newRecipient;
message.Conversation = new ConversationAccount(id: ConversationId.Id);
message.Text = $"Congratulations {user.Mentioned.Name}!, you have got a :tangerine: from {activity.From.Name}";
message.Locale = "en-Us";
message.Id = Guid.NewGuid().ToString();
var reply = await connector.Conversations.ReplyToActivityAsync((Activity)message);
還提高了下一個版本的錯誤消息。 – Lars
是的。這就是我最終做的。感謝你的回答 – Supreet