Skip to content

Instantly share code, notes, and snippets.

View frsechet's full-sized avatar
👋

Francois Falala-Sechet frsechet

👋
View GitHub Profile
start:
// The user has to specifically request a livechat session.
// A simple solution for this is to create a dedicated flow
// that handles all the livechat request lifecycle
// Start by providing a button to initiate the livechat session.
// This button must have a payload of LIVECHAT_SESSION_START
say Question(
"Do you need some help from a human agent?",
buttons=[Button("Yes, talk to a human!", payload="LIVECHAT_SESSION_START")]
@frsechet
frsechet / slack_components.csml
Last active June 30, 2022 09:18
Slack coverage of CSML components
start:
say "His palms are sweaty, knees weak, arms are heavy"
say Text("There's vomit on his sweater already, mom's spaghetti")
say "He's _nervous_, but **on the surface** he looks ~calm and ready~"
say Typing(2000)
say Question(
"Hi! My name is:",
buttons=[
Button("What?", payload="btn1"),
Button("Who?", payload="btn2", style="danger"),
@frsechet
frsechet / messenger_components.csml
Created May 3, 2020 17:01
Messenger/workplace chat coverage of CSML components
start:
say "His palms are sweaty, knees weak, arms are heavy"
say Text("There's vomit on his sweater already, mom's spaghetti")
say "He's _nervous_, but **on the surface** he looks ~calm and ready~"
say Typing(2000)
say Question("Hi! My name is:", buttons=[Button("What?"), Button("Who?")])
say Question(
"Hi! My name is:",
button_type="quick_reply",
buttons=[
@frsechet
frsechet / webapp_components.csml
Last active July 8, 2020 11:16
Webapp coverage of CSML components
start:
say "His palms are sweaty, knees weak, arms are heavy"
say Text("There's vomit on his sweater already, mom's spaghetti")
say "He's _nervous_, but **on the surface** he looks [calm and ready](https://www.youtube.com/watch?v=_Yhyp-_hX2s)"
say Typing(2000)
say Image("https://images.unsplash.com/photo-1560114928-40f1f1eb26a0")
say Question("Hi! My name is:", buttons=[Button("What?"), Button("Who?")])
say Question(
"Hi! My name is:",
buttons=[
@frsechet
frsechet / printer.cpp
Last active January 21, 2020 23:59
printer instructions
start:
use Button("Yes", accept=["oui", "yes", "y"]) as btny
use Button("No", accept=["non", "no", "nop", "nope"]) as btnn
say "Many printer issues come from empty cartridges."
say Question("Is that your case?", buttons=[btny, btnn])
hold
if (event match btnn) goto comments
say "Let's follow these simple steps to replace your ink cartridge!"
say "Step 1: Lift up the scanner unit and open the cartridge older."
say Image("https://cdn.csml.dev/customers/4140eea8-4825-4df6-981d-c1ee239884bc/files/29f64cb9-308b-4ff4-8e7c-ad2dfe20c37b/etape1.jpg")
bye:
say Typing(1000)
say "OK! Ping me whenever you need me!"
goto end
gethelp:
say Typing(1000)
say "I'm a nice bot helping you find out about your costs within your AWS account. Isn't that great?"
goto select
getforecast:
use Button("Today") as tdy
use Button("Tomorrow") as tmw
use Button("This month") as mo
use Button("This year") as yr
say Typing(1000)
say Question(
"OK, I'm going to check your cost forecast from your account in AWS Cost Explorer. What is the time period?",
buttons = [tdy, tmw, mo, yr]
)
getcosts:
use Button("Today") as tdy
use Button("Yesterday") as ysdy
use Button("Month to date") as mtd
use Button("Year to date") as ytd
use Button("Last month") as lm
say Typing(1000)
say Question(
"OK, I'm going to retrieve cost and usage data from your account in AWS Cost Explorer. What is the time period?",
buttons = [tdy, mtd, ytd, lm]
select:
use Button("Explore my costs", accept=["costs", "cost", "explorer"]) as btnexp
use Button("Get a forecast", accept=["forecast", "preview"]) as btnfcst
use Button("Who are you?", accept=["help"]) as btnhelp
use Button("Nothing, I'm good", accept=["nothing"]) as btnbye
say Question("What are you looking for?", buttons=[btnexp, btnfcst, btnhelp, btnbye])
hold
if (event match btnexp) goto getcost