TemplateSendMessage - CarouselTemplate
carousel_template_message = TemplateSendMessage(
alt_text='Carousel template',
template=CarouselTemplate(
最多只能有10個欄位
columns=[
CarouselColumn(
thumbnail_image_url='https://example.com/item1.jpg',
title='this is menu1',
text='description1',
actions=[
PostbackAction(
label='postback1',
display_text='postback text1',
data='action=buy&itemid=1'
),
MessageAction(
label='message1',
text='message text1'
),
URIAction(
label='uri1',
uri='http://example.com/1'
)
]
),
CarouselColumn(
thumbnail_image_url='https://example.com/item2.jpg',
title='this is menu2',
text='description2',
actions=[
PostbackAction(
label='postback2',
display_text='postback text2',
data='action=buy&itemid=2'
),
MessageAction(
label='message2',
text='message text2'
),
URIAction(
label='uri2',
uri='http://example.com/2'
)
]
)
]
)
)
Template with multiple columns which can be cycled like a carousel. The columns are shown in order when scrolling horizontally.
type
String Required
carousel
columns
Array of column objects Required
Array of columns
Max columns: 10
圖片的比例默認為square
imageAspectRatio
String Optional
Aspect ratio of the image.
One of:
rectangle: 1.51:1
square: 1:1
Applies to all columns. Default: rectangle
圖片大小默認是cover
imageSize
String Optional
Size of the image.
One of:
圖像填滿整個圖像區域。
cover: The image fills the entire image area. Parts of the image that do not fit in the area are not displayed.
整個圖像顯示在圖像區域中。
contain: The entire image is displayed in the image area. A background is displayed in the unused areas to the left and right of vertical images and in the areas above and below horizontal images.
Applies to all columns. Default: cover.
以上是圖片的解釋明天再講欄位