-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocationHelper.js
More file actions
22 lines (19 loc) · 797 Bytes
/
Copy pathlocationHelper.js
File metadata and controls
22 lines (19 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const builder = require('botbuilder');
var locationDialog = require('botbuilder-location');
module.exports = {
getLocationCarousel: (session, items, locationDialog) => {
// 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
message.addAttachment(new builder.HeroCard(session).title("Delivery for " + package.Location));
console.log(`location result ${package.Location}`);
locationDialog.getLocation(session,
{
prompt: "Where shall i ship your package?"
});
})
return message;
}
}