jolly-postman-63595
12/29/2023, 10:46 PMearly-train-33247
12/30/2023, 2:32 AMearly-train-33247
12/30/2023, 2:32 AMearly-train-33247
12/30/2023, 2:33 AMearly-train-33247
12/30/2023, 2:37 AMjs
// Function to create a card for a product
function createCardForProduct(product, index) {
return {
type: 'card',
title: {
dynamicValue: `${product.title}`,
valueType: 'dynamic'
},
imageUrl: {
dynamicValue: `${product.imagesSrc}`,
valueType: 'dynamic'
},
actions: [
{
action: 'url',
label: {
dynamicValue: 'Open',
valueType: 'dynamic'
},
value: {
dynamicValue: `${product.url}`,
valueType: 'dynamic'
}
}
]
// Add other card properties like subtitle, actions
// ...
}
}
// Create the carousel items
const carouselItems = products.map((product, index) => createCardForProduct(product, index))
// Send the carousel
bp.dm.replyToEvent(event, {
type: 'carousel',
items: carouselItems
})
early-train-33247
12/30/2023, 2:37 AMreplyToEvent
to send other types of messages as well
⚠️ This is an undocumented function that is subject to breaking changes. Use it at your own riskearly-train-33247
12/30/2023, 2:38 AMearly-train-33247
12/30/2023, 2:46 AMstraight-wolf-37371
12/30/2023, 4:31 AMjolly-postman-63595
12/30/2023, 2:17 PMjolly-postman-63595
12/30/2023, 3:13 PMearly-train-33247
01/04/2024, 3:22 PMearly-train-33247
01/04/2024, 3:23 PMadorable-gigabyte-54754
01/09/2024, 11:18 AMadorable-gigabyte-54754
01/09/2024, 1:06 PMearly-train-33247
01/11/2024, 5:33 PMearly-train-33247
01/11/2024, 5:33 PMquick-musician-29561
01/21/2024, 7:29 PMjolly-policeman-82775
01/24/2024, 11:28 AMjolly-policeman-82775
01/24/2024, 11:36 AMjolly-policeman-82775
01/24/2024, 11:37 AMjolly-policeman-82775
01/24/2024, 11:37 AMjolly-policeman-82775
01/24/2024, 11:41 AMearly-train-33247
02/20/2024, 2:10 PMjolly-policeman-82775
02/20/2024, 2:52 PMjolly-policeman-82775
02/20/2024, 2:52 PMcold-jewelry-54343
02/28/2024, 8:40 PMcold-jewelry-54343
02/28/2024, 8:41 PMearly-train-33247
02/29/2024, 2:46 PMproud-memory-60003
02/29/2024, 3:44 PMquick-musician-29561
02/29/2024, 4:44 PMproud-memory-60003
02/29/2024, 5:13 PM