Last active
June 12, 2023 02:59
-
-
Save sirateek/d38ba6448d66155bbc997fe3478c596d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function payloadCarousel(){ | |
var data = ["A", "B", "C", "D"] | |
var carouselContent = []; | |
data.forEach((eachData) => { | |
carouselContent.push( | |
{ | |
"type": "bubble", | |
"body": { | |
"type": "box", | |
"layout": "vertical", | |
"contents": [ | |
{ | |
"type": "text", | |
"text": eachData | |
} | |
] | |
} | |
} | |
); | |
}); | |
var payload = | |
{ | |
type: "flex", | |
altText: "Example", | |
contents: { | |
type: "carousel", | |
contents: carouselContent, | |
}, | |
} | |
return payload; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment