Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
start:
say "Hello, IT, I'm Roybot 🤖"
goto offandon
offandon:
say "Have you tried turning it off and on again ?"
say Question(
button_type="quick_reply",
buttons = [
Button("Yes", accepts=["yep", "sure", "ye", "yeah"]) as btnYes,
Button("No", accepts=["nope", "na", "nah"]) as btnNo
]
)
hold
if (event match btnYes) {
say "Ok, great!"
goto issue
}
say "Well, you should do that first."
say Typing(3000)
say "Don't worry though, come back to me if the issue persists."
goto end
issue:
say "Can you describe your the problem please?"
hold
remember issue = event
goto email
email:
say "What's your email address?"
hold
if (event.match_regex("^([a-z0-9_+]([a-z0-9_+.]*[a-z0-9_+])?)@([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,6})")) {
remember email = event
goto send
} else {
say "You won't fool me, this is not a valid email address 🥴"
goto email
}
goto send
send:
do ticket = Fn("zendesk", action="ticket", content="Customer : {{email}}. {{issue}}", subject="New ticket from {{_metadata.firstname}}")
say "Ok! I have created a ticket for your issue, the IT support team will reach out to you very soon !"
say "This is your ticket number {{ticket.id}}"
goto end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment