-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.swift
More file actions
40 lines (34 loc) · 1.3 KB
/
main.swift
File metadata and controls
40 lines (34 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import ChatbotKit
let resetPassword = FlowBuilder
.create(id: "reset_password", name: "Reset Password Flow") { f, start in
start <- f.choice("Enter your Password and your done") { choice in
return (
forgot: choice
<- f.option("ENTER_PASSWORD")
<- f.exit("Enter Password-Flow"),
done: choice
<- f.option("FORGOT_PASSWORD")
<- f.message("I have forgotten my password")
<- f.choice("Not to worry i just sent you an email with a reset code") { choice in
(
resend: choice <- f.option("RESEND"),
enter: choice <- f.option("ENTER_PASSWORD")
)
}
)
}
}
let login = FlowBuilder
.create(id: "login", name: "Login User") { f, start in
start <- f.choice("CHOICE LOGIN") { choice in
return (
email: choice
<- f.option("Email?"),
done: choice
<- f.option("Enter Password")
<- f.message("Enter")
<- f.exit("Done")
)
}
}
print(resetPassword.render())