Twyla聊天消息模板的集合
twyla-chat-templates的Python项目详细描述
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"))
回发和URL按钮
^{pr2}$通用模板
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")
- 项目
标签: