跳转到主要内容

Twyla聊天消息模板集合

项目描述

image image image image

Twyla聊天模板

Twyla聊天消息模板集合

安装

poetry install twyla-chat-templates

用法

快速回复按钮
quick_replies = QuickReplies(text="Which kind of chocolate do you prefer?")

# To add up to ten quick reply buttons:
quick_replies.add(QuickReply(title="Dark", payload="dark_chocolate"))
Postback和URL按钮
buttons = Buttons(text="What is your favourite type of pizza?")

# To add up to three buttons:
buttons.add(
        PostBackButton(title="Margherita", payload="x_Margherita_oaWVAeasEK_x"),
        UrlButton(title="Hawaii", url="https://google.com"),
    )
通用模板
element = GenericElement(
        title="Cheesecake",
        subtitle="Cake with cheese",
        image_url="https://cake.com/image.jpg",
        action_url="https://cake.com",
        buttons=[
            PostBackButton(
                title="I want Cheesecake", payload="x_I_want_Cheesecake_gkvMPBXXxO_x"
            ),
            UrlButton(title="Cheesecake, please", url="https://cheesecakeplease.com"),
        ],
    )
template =  GenericTemplate(elements=[element])
轮播模板
# To Create a vertically scrollable carousel, add up to 10 elements to the generic template: 
carousel = GenericTemplate(elements=[e1, e2, e3])
图片模板
image = ImageTemplate(url="https://pictures.com/picture.jpg")

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装软件包的更多信息。

源分布

twyla-chat-templates-0.1.0.tar.gz (4.2 kB 查看哈希)

上传时间:

构建分布

twyla_chat_templates-0.1.0-py3-none-any.whl (6.1 kB 查看哈希值)

上传时间 Python 3

支持