[DAY18]旋转木马(01)

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.
以上是图片的解释明天再讲栏位


<<:  Day 18 服务设计中的个资隐私保护旅程

>>:  day 24 - 失控的浮点数, decimal套件介绍

Day 16 - CSS Text Shadow Mouse Move Effect

前言 JS 30 是由加拿大的全端工程师 Wes Bos 免费提供的 JavaScript 简单应用...

Day 28 品质分数等於产品绩效吗?

我们在之前的分享中得知,品质分数多少会影响自然排序的表现,但很多人会把它和绩效挂上等号,这并不是必然...

自动化 End-End 测试 Nightwatch.js 之踩雷笔记:等待物件

前一篇利用 Nightwatch.js 的 pause(),并透过 global 设定了不同的等待时...

Day28 参加职训(机器学习与资料分析工程师培训班),网站设计与网页工程技术

今日练习爬虫,将爬下来的资料传到资料库(今日时间不够,下次上课再进行) BTC价格 import r...

【没钱买ps,PyQt自己写】Day 1 - 安装 PyQt,建立自己的第一支 PyQt5 程序

前言 今年算是拖到最後一天最後一刻才开赛... 因为疫情的关系今年实在有点忙不过来, 因此早在两个月...