在Microsoft Bot Framework中,如何发送具有表格格式的味精?

时间:2018-09-30 00:50:17

标签: node.js botframework

我正在尝试创建一个味精以发送给用户:

var msg = new Builder.Message().address(messageAddress);
msg.addAttachment(??);

bot.send(msg, (err)=>{
    if(err){
        reject(err);
    }
    resolve();
});

如何将表格添加到味精中?

表格示例:

enter image description here

1 个答案:

答案 0 :(得分:1)

我能够根据stackoverflow.com/a/48160573/2884059的答案进行此工作。

var msg: Builder.Message = new Builder.Message(session);
msg.addAttachment({
    "contentType": "application/vnd.microsoft.card.adaptive",
    "content":{
        "type": "AdaptiveCard",
        "version": "1.0",
        "body": [
            {
                "type": "ColumnSet",
                "columns": columnSet
            }
        ]
    }
});
session.endDialog(msg);