简体   繁体   English

使用Microsoft C#库或JSON Schema构建自适应卡?

[英]Build Adaptive card using Microsoft C# library or JSON Schema?

I am new to building webchat bot. 我是构建Webchat机器人的新手。 I have one built one webchat bot in C# using the Microsoft Bot framework. 我使用Microsoft Bot框架在C#中构建了一个网络聊天机器人。 I now need to add an Adaptive card to the app, my basic question is - Should I build the adaptive card using the Microsfot.AdaptiveCard library and the C# code or using the JSON schema? 现在,我需要向应用程序中添加一个自适应卡,我的基本问题是-我应该使用Microsfot.AdaptiveCard库和C#代码还是使用JSON模式来构建自适应卡? The reason for this question is I should be able to reuse the webchat bot code to any other platform/channel like Facebook, Slack, Apple iMessenger etc. and not limit to C#. 出现此问题的原因是,我应该能够将Webchat bot代码重用于Facebook,Slack,Apple iMessenger等任何其他平台/渠道,而不仅限于C#。

You're right -- sticking to JSON Schema is a good idea and will ensure that when you're using cards in other channels you don't have to convert & save from the C# Adaptive Cards library to a format the channels can read. 没错-坚持JSON Schema是一个好主意,它将确保在其他渠道中使用卡片时,不必将C#Adaptive Cards库中的转换并保存为渠道可以读取的格式。 In case you haven't seen these docs yet, here are the getting started docs for Adaptive Cards, and you can use the Schema Explorer and Visualizer to help build your cards. 如果您还没有看到这些文档,这里是自适应卡的入门文档,并且您可以使用Schema ExplorerVisualizer来帮助您构建卡。

This is irrelevant to you if if you're using JSON Schema, but to anyone who decides to use the AC Library, please note: The Adaptive Cards package has been updated from Microsoft.AdaptiveCards to AdaptiveCards, as well as a few other breaking changes . 如果您使用的是JSON模式,那么这与您无关,但是对于决定使用AC库的任何人,请注意:Adaptive Cards软件包已从Microsoft.AdaptiveCards更新为AdaptiveCards,以及其他一些重大更改

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM