[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.29 其他树的介绍

树有非常多变型,下面是Wiki的截图 以下简单介绍几种常听到的~ AVL Trees、Red Bla...

连续 30 天 玩玩看 ProtoPie - Day 21

今天来聊软性一点的事情。 其实跟 ProtoPie 互动到今天,觉得整体的体验都满好的。 影片的教学...

[sql] exec & sp_executesql 用法

EXEC 三部曲 exec '' exec ('') exec ('select * from db...

入门魔法 - 运算子的优先性与相依性

前情提要 艾草:「你的炫酷魔法的定义是什麽呀?」 「就是那种一施放後大家看到都会爱上我,觉得我好棒的...

Day19 - 【概念篇】OAuth flows: Device Code(1)

本系列文之後也会置於个人网站 +----------+ +----------------+ | ...