我的机器人在V3发布后的几天内工作正常,昨天突然出现问题,特别是当机器人试图在Facebook Messenger中呈现富卡附件时。这条消息显示在
上,而不是卡片服务错误:未将对象引用设置为对象的实例。
这是我创建Rich卡的方式:
replyMessage.Attachments = new List<Attachment>();
replyMessage.Attachments.Add(new Attachment()
{
Title = product.productName,
ThumbnailUrl = product.images[0],
Text = product.storeName,
Actions = new List<Microsoft.Bot.Connector.Action>() {
new Microsoft.Bot.Connector.Action() {
Title = Resources.es.VER,
Message = Resources.es.CALCULAR + " " + product.link
}
}
});
我的bot框架门户中提供的本地测试和测试连接模块按预期工作,没有任何问题。由于是一个V1 Bot,Rich卡附件使用了不赞成使用的方式,但是文档表明旧的方式应该仍然有用,但它不适用于Facebook频道。
答案 0 :(得分:0)
解决了!我只需要将属性ContentUrl = String.Empty添加到附件中,现在它就像正常一样。