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")
Metadata
Release files for twyla-chat-templates 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| twyla-chat-templates-0.1.0.tar.gz | 4.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| twyla_chat_templates-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.3 kB
Release files / twyla-chat-templates-0.1.0.tar.gz
| Download URL | twyla-chat-templates-0.1.0.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7926591b952d497855e46642635d80f6acc5411484abbb379169ae1815d92f6c
|
|
BLAKE2b-256 checksum How to use checksums |
fa9e7359989a48da520f78b5861ddf1edccff8440c3ed873a510b5ac9b0ba971
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.17 CPython/3.7.4 Linux/5.0.0-1022-azure
|
Release files / twyla_chat_templates-0.1.0-py3-none-any.whl
| Download URL | twyla_chat_templates-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
be359b9449fa5642370c7a23545770b9672372427f436a9f91f965a0ace858d7
|
|
BLAKE2b-256 checksum How to use checksums |
662d9ed452d206d522e89c287f11f048b5a5d17a92f091075140789b4de49a25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.17 CPython/3.7.4 Linux/5.0.0-1022-azure
|