Skip to content

Instantly share code, notes, and snippets.

@jazzedge
Created July 12, 2017 09:23
Show Gist options
  • Select an option

  • Save jazzedge/5fc6f5f50143652dcd4973af4e36e400 to your computer and use it in GitHub Desktop.

Select an option

Save jazzedge/5fc6f5f50143652dcd4973af4e36e400 to your computer and use it in GitHub Desktop.
Bot Rich cards - Carousel
var bot = new builder.UniversalBot(connector, function (session) {
var cards = getCardsAttachments();
// create reply with Carousel AttachmentLayout
var reply = new builder.Message(session)
.attachmentLayout(builder.AttachmentLayout.carousel)
.attachments(cards);
session.send(reply);
});
function getCardsAttachments(session) {
return [
new builder.HeroCard(session)
.title('Azure Storage')
.subtitle('Offload the heavy lifting of data center management')
.text('Store and help protect your data. Get durable, highly available data storage across the globe and pay only for what you use.')
.images([
builder.CardImage.create(session, 'https://roccobot02gghwh4.blob.core.windows.net/images/PlanningHighestPointRoof.jpg')
])
.buttons([
builder.CardAction.openUrl(session, 'https://azure.microsoft.com/en-us/services/storage/', 'Learn More')
]),
new builder.ThumbnailCard(session)
.title('DocumentDB')
.subtitle('Blazing fast, planet-scale NoSQL')
.text('NoSQL service for highly available, globally distributed apps—take full advantage of SQL and JavaScript over document and key-value data without the hassles of on-premises or virtual machine-based cloud database options.')
.images([
builder.CardImage.create(session, 'https://roccobot02gghwh4.blob.core.windows.net/images/PlanningBalcony.jpg')
])
.buttons([
builder.CardAction.openUrl(session, 'https://azure.microsoft.com/en-us/services/documentdb/', 'Learn More')
]),
new builder.HeroCard(session)
.title('Azure Functions')
.subtitle('Process events with a serverless code architecture')
.text('An event-based serverless compute experience to accelerate your development. It can scale based on demand and you pay only for the resources you consume.')
.images([
builder.CardImage.create(session, 'https://roccobot02gghwh4.blob.core.windows.net/images/PlanningAlterChimney.jpg')
])
.buttons([
builder.CardAction.openUrl(session, 'https://azure.microsoft.com/en-us/services/functions/', 'Learn More')
]),
new builder.ThumbnailCard(session)
.title('Cognitive Services')
.subtitle('Build powerful intelligence into your applications to enable natural and contextual interactions')
.text('Enable natural and contextual interaction with tools that augment users\' experiences using the power of machine-based intelligence. Tap into an ever-growing collection of powerful artificial intelligence algorithms for vision, speech, language, and knowledge.')
.images([
builder.CardImage.create(session, 'https://roccobot02gghwh4.blob.core.windows.net/images/PlanningLoftEavesDistance.jpg')
])
.buttons([
builder.CardAction.openUrl(session, 'https://azure.microsoft.com/en-us/services/cognitive-services/', 'Learn More')
])
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment