carousel
Messenger Generic Templates Carousel.
carousel(elements=Array, quick_replies=Array, image_aspect_ratio=:horizontal|:square)
carousel(elements=Array, quick_replies=Array, image_aspect_ratio=:horizontal|:square)
Platforms
Platform
Supported
Messenger
Telegram
Usage
news = feed_entries("https://rss.nytimes.com/services/xml/rss/nyt/World.xml")
@reply.notification.carousel(
news[0..9].map{|article|
{
title: article.title,
image_url: article.image.to_s,
subtitle: article.summary.to_s.truncate(50),
default_action: {
type: :web_url,
url: article.url,
webview_height_ratio: :tall,
messenger_extensions: true
},
buttons: [
{
type: :web_url,
url: article.url,
title: "Read more",
webview_height_ratio: :tall,
messenger_extensions: true
}
]
}
},
[
{
title: "Read CNN",
payload: "news/cnn_carousel"
}
],
:square
)
Params
Name
Description
elements
Required.
Array with Messenger Generic Templates. There can be no more than 10 items.
quick_replies
Optional. Array of quick replies displayed bellow the carousel.
image_aspect_ratio
Optional.
Carousel images can be :horizontal
or :square
.
By default :horizontal
.
Last updated
Was this helpful?