我正在開發一個帶有微軟bot框架的Facebook bot。 我想發送自定義消息給Facebook用戶,所以我使用自定義channelData方法。你可以在這裏找到: channelData Config. 這裏是我的代碼:C#通過bot框架發送模板facebook消息
var reply = activity.CreateReply();
reply.ChannelData = new
{
attachment = (text as SendPackage).message.attachment,
notification_type = "NO_PUSH"
};
var result = await connector.Conversations.ReplyToActivityAsync(reply);
我測試模擬器,但channelData財產送花兒給人空:
{
"type": "message",
"timestamp": "2016-11-24T02:30:44.9047645Z",
"from": {
"id": "56800324",
"name": "Bot1"
},
"conversation": {
"id": "8a684db8",
"name": "Conv1"
},
"recipient": {
"id": "2c1c7fa3",
"name": "User1"
},
"text": "",
"channelData": {},
"replyToId": "3f223b935086422da7ed36786ab05cb9"
}
結果返回從ReplyToActivityAsync爲空過。 有沒有人有這個問題? 謝謝。