私は会話IDをキーにして、送受信されたすべてのアクティビティをアクティビティオブジェクト(JSON)としてテーブルストレージに保存するボットを実装しました。会話にユーザーとボットアクティビティを投稿する方法
ユーザが会話に再接続すると、関連する会話IDを使用してテーブルストレージからすべてのアクティビティを送信したいとします。
問題は、もともとボットから送信されたアクティビティは正常に機能しますが、ユーザーのアクティビティは会話では表示されません。私はBotframeworkエミュレータでこれをテストしました。エラーは発生しません。 私は正しく活動を作成していないと思います。ここで
は私のコードは
VAR confJSONObj = JsonConvert.DeserializeObject(logEntry.ActivityJson)(confJSONObjは、以前に保存されたアクティビティ情報が含まれている)です。
if (confJSONObj.Type.Contains("message"))
{
IMessageActivity message2 = Activity.CreateMessageActivity();
message2.Recipient = confJSONObj.Recipient;
message2.From = confJSONObj.From;
message2.Conversation = confJSONObj.Conversation;
message2.ChannelId = confJSONObj.ChannelId;
message2.Text = confJSONObj.Text;
message2.Speak = confJSONObj.Text;
message2.Locale = confJSONObj.Locale;
message2.Type = confJSONObj.Type;
message2.Id = confJSONObj.Id;
message2.Timestamp = confJSONObj.Timestamp;
message2.LocalTimestamp = confJSONObj.LocalTimestamp;
message2.ServiceUrl = confJSONObj.ServiceUrl;
message2.TextFormat = confJSONObj.TextFormat;
message2.ChannelData = confJSONObj.ChannelData;
message2.Attachments = confJSONObj.Attachments;
await connector.Conversations.SendToConversationAsync((Activity)message2);
}
お返事ありがとうございます。 Issue 365がWebChatの正式リリースに含まれることをご存知ですか? – Erkki