.net-core - 如何在类似于 Who bot 的 Teams bot 中构建具有滚动条的列表卡?
问题描述
我正在使用 .NET Core 开发 MS Teams 机器人。来自 Microsoft 的 Who bot 有这张带有滚动条的列表卡。
我没有找到实现它的代码,就像我们有缩略图卡,英雄卡等。请提前帮助和感谢。
解决方案
我认为您需要尝试使用列表卡。由于它是 json 卡,因此您需要将其作为附件发送。
private static Attachment CreateListCardAttachment()
{
// combine path for cross platform support
string[] paths = { ".", "Resources", "listCard.json" };
var listCardJson = File.ReadAllText(Path.Combine(paths));
var listCardAttachment = new Attachment()
{
ContentType = "application/vnd.microsoft.teams.card.list",
Content = JsonConvert.DeserializeObject(listCardJson),
};
return listCardAttachment;
}
请使用此json 代码作为参考。
推荐阅读
- javascript - 如何将变量传递给 html 提交和 php isset 以允许它们匹配?
- django - 如何设置用户可以删除或更新它的时间?
- sql - 为什么不能批量插入格式 csv?
- c# - 使用 C# 将 SAS 日期时间值转换为数据表中的日期时间字符串
- java - Selenium 在并行运行测试时处理 ProtocolHandshake 错误
- javascript - 刷新后 vuejs 道具未定义
- c++ - 如何在 C++ 中对接口/超类型进行编程?
- formbuilder - 如何使用 go_block 在 oracle 表单生成器中创建搜索查询按钮?
- r - 如何删除字符串中包含“.com”但有链接的所有内容?
- python - 将行复制到另一个数据框