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.0a0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b3f37800f165e26f6c4e8fd2757afd9fe4f0267ba3cf3ffe46a07004d2de94b |
|
MD5 | 0766711ea67e412b8add28034711a987 |
|
BLAKE2b-256 | 97d8298f9f9ceb7a19725fa821b2c1e57f5332d36493e11c20a064b0253f5b0d |
Close
Hashes for twyla_chat_templates-0.1.0a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97a87a7830d115960e364dfabf97ec7e4d49ff863e2a77f677a745eeb78e0b6d |
|
MD5 | c4a23908e4dbb23b50baaee2254c6b2a |
|
BLAKE2b-256 | 47b57c419b5e58f6d5369d435b5c5166c1ba55d2c82e76d0ef2604e2e76b26c7 |