Skip to main content

A collection of Twyla chat message templates

Project description

image image image image

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for twyla-chat-templates, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size twyla_chat_templates-0.1.0-py3-none-any.whl (6.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size twyla-chat-templates-0.1.0.tar.gz (4.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page