如何在其中创建卡片数量未知的消息

时间:2018-10-08 12:32:21

标签: javascript node.js botframework

我正在尝试创建 MessageFactory 或任何类型的 Message ,这些附件都带有带有 title 每张卡的按钮,希望获得帮助。

var attachments = []
clients.forEach((client)=> {

   if(client === selectedClient){

      numberOfPlans(client)
   }
}

function numberOfPlans(client){

  while(client.plans[i] !== undefined){

     const card = client.plans[i]

     **This does not work**
     // const card = MessageFactory.carousel(
     //   CardFactory.heroCard(dc)
     //   .title(client["Valued Entry Number "+i+" Description"])
     //   .button("Select")
     // );
     **This is what I'm trying to do**

     attachments.push(card)
     i++;

  }


}


const message = MessageFactory.suggestedActions(carePlansCards);
**This does not work**
// const message = MessageFactory.carousel([{
//   text: "IT WORKS",
//   actions: carePlansCards
// }])

 await dc.prompt(CSELECT_PLAN, message)
 return dc.endDialog()

如您在屏幕快照中所见,我能够仅使用按钮上的标题来创建卡片,但它已被删除。

enter image description here

0 个答案:

没有答案