0
所以我有第一個運行對話框要求用戶上傳照片。我通過這樣做:使用Node.js顯示圖像Microsoft Bot Framework
builder.Prompts.attachment(session, "Thanks. Now upload a picture").
,然後在瀑布下一部分,保存上傳媒體session.userData
像這樣:
function(session, results) {
//some other code
builder.Prompts.attachment(session, "Thanks. Now upload a picture.");
},
function(session, results) {
session.userData.profilePhoto = results.response;
session.endDialog("All done.")
}
所以說我也知道要顯示的照片。我會怎麼做?
我試圖發送一個HeroCard
與CardImage
:
var message = new builder.Message(session);
var att = new builder.HeroCard(session)
.images([
builder.CardImage.create(session, session.userData.profilePhoto)
])
.buttons([
builder.CardAction.openUrl(session, "http://google.com", "buttonText")
]);
message.addAttachment(att);
session.send(message)
,但沒有工作(我也試圖爲CardImage但沒有工作做session.userData.profilePhoto.contentUrl
以及)。
我想如何顯示圖像?
好的,但即使如此,我將如何顯示這些存儲的圖像?我是否需要將它們存儲在某種類型的數據庫中,該數據庫提供了一個URL並將其傳遞到'CardImage'中? Node.js文檔目前沒有寫在圖像上的指南,所以我正在尋找一些關於使用我的機器人顯示圖像的一般信息。 – Orbit
Azure Blog Storage有一個非常簡單的node.js庫。 https://azure.microsoft.com/en-us/documentation/articles/storage-nodejs-how-to-use-blob-storage/ – Lars
我會看看它,謝謝。 – Orbit