Botframework “url类型”按钮的Web url不能为空 var msg=context.MakeMessage(); msg.Attachments=新列表(); SigninCard卡=新SigninCard() { Text=“链接它”, 按钮=新列表 { 新名片 { Value=“帐户链接url https”, Type=“帐户链接”, Title=“Link” }, } }; msg.Attachments.Add(card.ToAttachment()); wait context.PostAsync(msg);

Botframework “url类型”按钮的Web url不能为空 var msg=context.MakeMessage(); msg.Attachments=新列表(); SigninCard卡=新SigninCard() { Text=“链接它”, 按钮=新列表 { 新名片 { Value=“帐户链接url https”, Type=“帐户链接”, Title=“Link” }, } }; msg.Attachments.Add(card.ToAttachment()); wait context.PostAsync(msg);,botframework,Botframework,我正在尝试使用SignInCard链接Facebook帐户。 出现以下错误: {“错误”:{“消息”:“(#100)对于url类型,Web url不能为空 按钮,“类型”:“OAutheException”,“代码”:100,“错误子代码”:2018041,“fbtrace\u id”:“GclYUUuTL2D”} 但url字段中有一个字符串https url 有什么想法吗?我想出来了 var msg = context.MakeMessage(); msg.Att

我正在尝试使用SignInCard链接Facebook帐户。 出现以下错误:

{“错误”:{“消息”:“(#100)对于url类型,Web url不能为空 按钮,“类型”:“OAutheException”,“代码”:100,“错误子代码”:2018041,“fbtrace\u id”:“GclYUUuTL2D”}

但url字段中有一个字符串https url

有什么想法吗?

我想出来了

 var msg = context.MakeMessage();


            msg.Attachments = new List<Attachment>();

            SigninCard card = new SigninCard()
            {
                 Text= "link it",

                Buttons = new List<CardAction>
                         {
                             new CardAction
                            {

                                Value = "account linking url https",
                                Type = "account_link",
                                Title = "Link"

                            },

                        }
            };

            msg.Attachments.Add(card.ToAttachment());


 await context.PostAsync(msg);

您不必进入特定于频道的
ChannelData
。在
符号卡的按钮初始值设定项中,而不是

var msg = context.MakeMessage();


            dynamic messageData = new JObject();
            messageData.attachment = new JObject();
            messageData.attachment.type = "template";
            messageData.attachment.payload = new JObject();
            messageData.attachment.payload.template_type = "generic";


            messageData.attachment.payload.elements
                = new JArray(
                    new JObject(
                        new JProperty("title", "title"),
                        new JProperty("subtitle", "Link your account"),
                        new JProperty("buttons",
                            new JArray(
                                new JObject(
                                    new JProperty("type", "account_link"),
                                    new JProperty("url", "yourUrl")
                                )
                            )
                        )
                    )
                );


            msg.ChannelData = messageData;


                await context.PostAsync(msg);
使用


在我的Facebook Messenger频道工作。

我今天也遇到了同样的问题。有点疯狂,你必须使用特定于频道的数据来绕过它,不是吗?HeroCard应该是通道不可知的。是否存在GitHub问题,你知道吗?更新:我使用的是'Type=ActionTypes.MessageBack'。当我切换到'Type=ActionType.ImBack'时,它起了作用。我认为一个类似的枚举变化将为您工作-答案张贴。
Type = "account_link",
Type = ActionTypes.Signin,