Twyla聊天消息模板集合
项目描述
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.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 7926591b952d497855e46642635d80f6acc5411484abbb379169ae1815d92f6c |
|
MD5 | 2486f927baa2851aabee25beae669a32 |
|
BLAKE2b-256 | fa9e7359989a48da520f78b5861ddf1edccff8440c3ed873a510b5ac9b0ba971 |
关闭
twyla_chat_templates-0.1.0-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | be359b9449fa5642370c7a23545770b9672372427f436a9f91f965a0ace858d7 |
|
MD5 | 7592bf103e7239efe31f09c0fb94cc09 |
|
BLAKE2b-256 | 662d9ed452d206d522e89c287f11f048b5a5d17a92f091075140789b4de49a25 |