A collection of Twyla chat message templates
Project description
Twyla Chat Templates
A collection of Twyla chat message templates
Installation
poetry install twyla-chat-templates
Usage
Quick reply buttons
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 and URL Buttons
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"),
)
Generic Template
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])
Carousel Template
# To Create a vertically scrollable carousel, add up to 10 elements to the generic template:
carousel = GenericTemplate(elements=[e1, e2, e3])
Image Template
image = ImageTemplate(url="https://pictures.com/picture.jpg")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for twyla-chat-templates-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7926591b952d497855e46642635d80f6acc5411484abbb379169ae1815d92f6c |
|
MD5 | 2486f927baa2851aabee25beae669a32 |
|
BLAKE2b-256 | fa9e7359989a48da520f78b5861ddf1edccff8440c3ed873a510b5ac9b0ba971 |
Close
Hashes for twyla_chat_templates-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be359b9449fa5642370c7a23545770b9672372427f436a9f91f965a0ace858d7 |
|
MD5 | 7592bf103e7239efe31f09c0fb94cc09 |
|
BLAKE2b-256 | 662d9ed452d206d522e89c287f11f048b5a5d17a92f091075140789b4de49a25 |