-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessageHelper.js
More file actions
23 lines (23 loc) · 1.08 KB
/
Copy pathmessageHelper.js
File metadata and controls
23 lines (23 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const builder = require('botbuilder');
var testimg = "https://upload.wikimedia.org/wikipedia/commons/thumb/7/7a/Suit.jpg/367px-Suit.jpg";
module.exports = {
getPackageCarousel: (session, items) => {
// results found
var message = new builder.Message(session).attachmentLayout(builder.AttachmentLayout.carousel);
items.forEach((package) => {
// custom card for packages
// update with your specific fields for output
console.log(`query result ${package.imageURL}`);
message.addAttachment(
new builder.HeroCard(session)
.title("Delivery for " + package.Name)
.subtitle("Package: " + package.Package + " | " +
"Status: " + package.Status + " | Score: " + package['@search.score'])
.text(package.Description)
.images([builder.CardImage.create(session, testimg)])
//.images([builder.CardImage.create(session, package.imageURL)])
);
})
return message;
}
}