![](/img/trans.png)
[英]Bot Framework V4 Choice Prompt with Hero Card c#
[英]Bot framework v4 hero card share button
我正在使用Bot框架v4構建Bot。 我具有在頻道內共享英雄卡的功能。 即,如果該機器人被部署在facebook中,我們也需要在Skype的聯系人中共享。 我該如何實現?
提前致謝。
通過Skype發送的任何卡都已經具有轉發給其他用戶的功能。 用戶要做的就是按下顯示在卡側面的前進按鈕。 但是,Skype不支持直接在卡上添加共享按鈕。
您必須通過活動的渠道數據發送Messenger模板 ,以包括Facebook Messenger上的共享功能。 在模板的元素中,您必須添加一個類型為element_share
的按鈕。 請參見下面的示例。
await turnContext.sendActivity({
channelData: {
"attachment": {
"type": "template",
"payload": {
"template_type": "generic",
"elements": [
{
"title": "Three Strategies for Finding Snow",
"subtitle": "How do you plan a ski trip to ensure the best conditions? You can think about a resort’s track record, or which have the best snow-making machines. Or you can gamble.",
"image_url": "https://static01.nyt.com/images/2019/02/10/travel/03update-snowfall2/03update-snowfall2-jumbo.jpg?quality=90&auto=webp",
"default_action": {
"type": "web_url",
"url": "https://www.nytimes.com/2019/02/08/travel/ski-resort-snow-conditions.html",
"messenger_extensions": false,
"webview_height_ratio": "tall"
},
"buttons": [{
"type":"element_share"
}]
}
]
}
}
}
});
希望這可以幫助!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.