MS Bot:如何创建自定义卡片

时间:2017-05-10 12:39:32

标签: botframework adaptive-cards

是否可以创建像Hero Card这样的自定义卡或扩展现有的Hero Card(Carousel Model),添加更多字段?

2 个答案:

答案 0 :(得分:1)

不可能。这些卡转换为消息传递平台可以本地显示的内容。如果您选择的频道支持机器人框架没有抽象的东西,您可以发送原始JSON:

Microsoft BotFramework: How to send raw JSON message to channels?

答案 1 :(得分:0)

请查看http://adaptivecards.io

一些文档:https://docs.microsoft.com/en-us/bot-framework/dotnet/bot-builder-dotnet-add-rich-card-attachments

int *cntPtr; int rowCnt; sem_t s; sem_t c; sem_t r; int main(int argc, int *argv[]) { int pid, pid2, pid3, i; CreateBuf1(); CreateBuf2(); CreateCounter(); GetInput(argv[1],*buf1Ptr); sem_init(&c, 0, 1); sem_init(&r, 0, 1); sem_init(&s, 0, 1); for( i = 0 ; i < 9; i++) { pid = fork(); if(pid < 0) { printf("Fork error !\n"); } else if (pid == 0) break; } if(pid < 0) { printf("Fork error !\n"); } else if (pid == 0) { sem_wait(&r); Grp1 (i,i); cntPtr+=rowCnt; sleep(1); sem_post(&r); sem_post(&c); exit(0); } else { wait(NULL); } pid2 = fork(); if(pid2 < 0) { printf("Fork error !\n"); } else if (pid2 == 0) { sem_wait(&c); Grp2(9); cntPtr+=colCnt; sleep(1); sem_post(&c); exit(0); } else { wait(NULL); } // This space is to print the values.............. shmctl(shmBuf1id,IPC_RMID,0); shmctl(shmBuf2id,IPC_RMID,0); shmctl(shmCntid,IPC_RMID,0); return 0; } 支持添加Adaptive Cards,不同TextBlocks类型,定义InputSubmit操作以及大量自定义项。

有nuget和npm包:

https://www.nuget.org/packages/Microsoft.AdaptiveCards/

https://www.npmjs.com/package/microsoft-adaptivecards

源代码在GitHub上:https://github.com/Microsoft/AdaptiveCards