Skip to content

Instantly share code, notes, and snippets.

@bastienbot
Last active August 7, 2020 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bastienbot/39af60477f77bbd96e724c8e68fb64e0 to your computer and use it in GitHub Desktop.
Save bastienbot/39af60477f77bbd96e724c8e68fb64e0 to your computer and use it in GitHub Desktop.
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